Sha256: 798d40b91c6344e9448dd07a4bb35c256929fcabce2ef2f5e1488f2324f79821

Contents?: true

Size: 1.55 KB

Versions: 16

Compression:

Stored size: 1.55 KB

Contents

# frozen_string_literal: true

module EveOnline
  module Formulas
    class BlueprintCopyTime
      attr_reader :seconds, :science_level, :advanced_industry_level,
        :science_copy_speed_bonus_per_level,
        :advanced_industry_skill_industry_job_time_bonus_per_level, :runs

      def initialize(seconds, science_level, advanced_industry_level,
        science_copy_speed_bonus_per_level,
        advanced_industry_skill_industry_job_time_bonus_per_level,
        runs = 1)
        @seconds = seconds
        @science_level = science_level
        @advanced_industry_level = advanced_industry_level
        @science_copy_speed_bonus_per_level = science_copy_speed_bonus_per_level
        @advanced_industry_skill_industry_job_time_bonus_per_level = advanced_industry_skill_industry_job_time_bonus_per_level
        @runs = runs
      end

      def time
        (BigDecimal(seconds.to_s) * BigDecimal(time_modifier.to_s) * BigDecimal(runs.to_s)).to_f
      end

      def time_modifier
        science_copy_bonus_time_modifier * advanced_industry_job_time_bonus_time_modifier
      end

      def science_copy_bonus
        science_level * science_copy_speed_bonus_per_level
      end

      def science_copy_bonus_time_modifier
        (100.0 + science_copy_bonus) / 100.0
      end

      def advanced_industry_job_time_bonus
        advanced_industry_level * advanced_industry_skill_industry_job_time_bonus_per_level
      end

      def advanced_industry_job_time_bonus_time_modifier
        (100.0 + advanced_industry_job_time_bonus) / 100.0
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
eve_online-0.46.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.45.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.44.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.43.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.42.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.41.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.40.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.39.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.38.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.37.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.36.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.35.1 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.35.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.34.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.33.0 lib/eve_online/formulas/blueprint_copy_time.rb
eve_online-0.32.0 lib/eve_online/formulas/blueprint_copy_time.rb