class Edj::ScanItem

Public Instance Methods

bodyName() click to toggle source
# File lib/edj/scan.rb, line 13
def bodyName()
        @raw["BodyName"]
end
body_value() click to toggle source
# File lib/edj/scan.rb, line 21
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
solar_value() click to toggle source
# File lib/edj/scan.rb, line 65
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
terraformable?() click to toggle source
# File lib/edj/scan.rb, line 17
def terraformable?()
        @raw["TerraformState"] != ""
end
value() click to toggle source
# File lib/edj/scan.rb, line 5
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