Class: Hlockey::Game::Weather::Sunset
- Inherits:
-
Object
- Object
- Hlockey::Game::Weather::Sunset
- Includes:
- Weatherable
- Defined in:
- lib/hlockey/game/weather/sunset.rb
Overview
Sunset weather Makes each team’s goals worth less the more the team scores
Instance Method Summary collapse
Methods included from Weatherable
#initialize, #on_action, #on_game_end, #on_period_end
Methods included from SelfDescribable
Instance Method Details
#on_game_start ⇒ Object
12 |
# File 'lib/hlockey/game/weather/sunset.rb', line 12 def on_game_start = @score_amt = { home: 0, away: 0 } |
#on_goal(scoring_team) ⇒ Object
14 15 16 17 |
# File 'lib/hlockey/game/weather/sunset.rb', line 14 def on_goal(scoring_team) @score_amt[scoring_team] += 1 @game.score[scoring_team] -= @score_amt[scoring_team] * 0.3 end |