Class: Game

Inherits:
Entity show all
Defined in:
lib/ttr/entities/game.rb

Overview

Copyright © 2011 Jesse Sielaff

Instance Method Summary collapse

Methods inherited from Entity

inherited, #initialize

Constructor Details

This class inherits a constructor from Entity

Instance Method Details

#available_colorsObject

Returns an Array of the colors of the Cards available for selection.



9
10
11
# File 'lib/ttr/entities/game.rb', line 9

def available_colors
  @obj.deck.available_colors
end

#citiesObject

Returns an Array of all Cities in the Game.



15
16
17
# File 'lib/ttr/entities/game.rb', line 15

def cities
  City.entities(@obj.city_objs)
end

#routesObject

Returns an Array of all Routes in the Game.



21
22
23
# File 'lib/ttr/entities/game.rb', line 21

def routes
  Route.entities(@obj.route_objs)
end

#unclaimed_routesObject

Returns an Array of all unclaimed Routes in the Game.



27
28
29
# File 'lib/ttr/entities/game.rb', line 27

def unclaimed_routes
  Route.entities(@obj.route_objs.reject {|obj| obj.player_obj })
end