Sha256: d9343b75d854e6eca9e744568cb82e6160f31bb2a15cfa6cb1972dc4b16a293f

Contents?: true

Size: 1.65 KB

Versions: 1

Compression:

Stored size: 1.65 KB

Contents

module Edj
	class ScanItem < Item

		def value()
			return body_value if @raw["PlanetClass"]
			return solar_value if @raw["StarType"]
			return 2000 if @raw["BodyName"] =~ /Belt Cluster/
			STDERR.puts("#{@raw}")
			raise
		end

		def bodyName()
			@raw["BodyName"]
		end

		def terraformable?()
			@raw["TerraformState"] != ""
		end

		def body_value()
			case @raw["PlanetClass"]
			when "High metal content body"
				return 412249 if terraformable?
				34310
			when "Icy body"
				1246
			when "Ammonia world"
				320203
			when "Water world"
				return 694971 if terraformable?
				301410
			when "Rocky ice body"
				928
			when "Sudarsky class I gas giant"
				7013
			when "Sudarsky class III gas giant"
				2693
			when "Rocky body"
				return 181104 if terraformable?
				928
			when "Metal rich body"
				65045
			when "Earthlike body"
				627885
			when "Gas giant with water based life"
				2314
			when "Sudarsky class II gas giant"
				53663
			when "Water giant"
				1824
			when "Gas giant with ammonia based life"
				1721
			when "Sudarsky class IV gas giant"
				2799
			when "Sudarsky class V gas giant"
				2761
			else
				STDERR.puts("#{@raw}")
				STDERR.puts("when \"#{@raw["PlanetClass"]}\"")
				raise
			end
		end

		def solar_value()
			case @raw["StarType"]
			when "A"
				2949
			when "B"
				3012
			when "DA"
				34294
			when "F"
				2932
			when "G"
				2919
			when "H"
				60589
			when "K"
				2916
			when "L"
				2889
			when "M"
				2903
			when "M_RedGiant"
				3122
			when "T"
				2895
			when "TTS"
				2000
			when "Y"
				2881
			else
				STDERR.puts("#{@raw}")
				STDERR.puts("when \"#{@raw["StarType"]}\"")
				raise
			end
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
edj-0.1.0 lib/edj/scan.rb