Method: PlayerObject#initialize
- Defined in:
- lib/ttr/objects/player.rb
#initialize(deck_obj, player_objs, route_objs, script, ticket_objs) ⇒ PlayerObject
Returns a new instance of PlayerObject.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/ttr/objects/player.rb', line 7 def initialize (deck_obj, player_objs, route_objs, script, ticket_objs) @deck = deck_obj @script = script @all_player_objs = player_objs @all_route_objs = route_objs @remaining_ticket_objs = ticket_objs @candidate_ticket_objs = [] @kept_ticket_objs = [] @claimed_route_objs = [] @score = 0 @trains = 45 @selections = [] @cards = { wild:[], black:[], blue:[], green:[], orange:[], pink:[], red:[], white:[], yellow:[] } 4.times do card = @deck.draw @cards[card.color] << card end @action_begun = false @turn_completed = false @draws_remaining = 0 end |