class Game
Attributes
players[RW]
An Hash of Player
in the current game
teams[RW]
An Hash of Team
in the current game
Public Class Methods
new()
click to toggle source
# File lib/herostats/game.rb, line 6 def initialize @players = {} @teams = {1 => Team.new, 2 => Team.new} end
Public Instance Methods
add_player(player)
click to toggle source
Adds a player to the @param
# File lib/herostats/game.rb, line 13 def add_player(player) @players[@players.count + 1] = player end
blue_team()
click to toggle source
Alias for team 1
# File lib/herostats/game.rb, line 18 def blue_team teams[1] end
red_team()
click to toggle source
Alias for team 2
# File lib/herostats/game.rb, line 22 def red_team teams[2] end