class Astromapper::Builder::Planet
Public Class Methods
new(star,orbit_number)
click to toggle source
Calls superclass method
Astromapper::Builder::Orbit::new
# File lib/astromapper/builder/orbit.rb, line 119 def initialize(star,orbit_number) super @moons = make_moons(toss(1,3)) @size = toss if @size.nil? or @size == 0 end
Public Instance Methods
make_moons(c)
click to toggle source
# File lib/astromapper/builder/orbit.rb, line 124 def make_moons(c) moons = {} c.times { |i| m = Moon.new(self,i) moons["#{m.orbit}"] = m } moons.values.sort{ |a,b| a.orbit <=> b.orbit } unless @moons.size < 2 end
uwp()
click to toggle source
# File lib/astromapper/builder/orbit.rb, line 132 def uwp "%s%s%s%s%s%s%s-%s" % [port, @size.hexd, @atmo.hexd, @h20.hexd, @popx.hexd, @govm.hexd, @law.hexd, @tek.hexd] end