Class: Astromapper::Builder::GasGiant

Inherits:
Planet show all
Defined in:
lib/astromapper/builder/orbit.rb

Instance Attribute Summary

Attributes inherited from Orbit

#au, #id, #kid, #orbit_number, #port, #xsize

Attributes inherited from Base

#root_dir

Instance Method Summary collapse

Methods inherited from Planet

#make_moons

Methods inherited from Orbit

#biozone?, #distant?, #inner?, #km, #limit?, #outer?, #period, #populate, #populate_biozone, #populate_inner, #populate_outer, #radii, #to_ascii, #to_s

Methods inherited from Base

#config, constitute, #names, #spawn_command, #toss

Constructor Details

#initialize(star, orbit_number) ⇒ GasGiant

Returns a new instance of GasGiant.



154
155
156
157
158
159
160
161
# File 'lib/astromapper/builder/orbit.rb', line 154

def initialize(star,orbit_number)
  super
  @xsize = (toss(1,0) < 4) ? 'L' : 'S'
  moons = toss(2,0)
  moons = (moons - 4).whole if @xsize == 'S'
  @moons = make_moons(moons)
  @kid = 'G'
end

Instance Method Details

#uwpObject



162
163
164
# File 'lib/astromapper/builder/orbit.rb', line 162

def uwp
  (@xsize == 'S') ? 'Small GG ' : 'Large GG '
end