Class: TurnManager

Inherits:
Object show all
Includes:
FromHash
Defined in:
lib/ascension/turn_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#gameObject

Returns the value of attribute game.



4
5
6
# File 'lib/ascension/turn_manager.rb', line 4

def game
  @game
end

Instance Method Details

#advance!Object



9
10
11
12
13
# File 'lib/ascension/turn_manager.rb', line 9

def advance!
  current_side.end_turn!
  self.current_side_index = current_side_index + 1
  self.current_side_index = 0 if current_side_index >= game.sides.size
end

#current_sideObject



6
7
8
# File 'lib/ascension/turn_manager.rb', line 6

def current_side
  game.sides[current_side_index]
end