Class: PlaylyfeClient::Action
- Inherits:
-
Object
- Object
- PlaylyfeClient::Action
- Defined in:
- lib/playlyfe_client/action.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#game ⇒ Object
readonly
Returns the value of attribute game.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#game ⇒ Object (readonly)
Returns the value of attribute game.
6 7 8 |
# File 'lib/playlyfe_client/action.rb', line 6 def game @game end |
Class Method Details
.all(game) ⇒ Object
8 9 10 |
# File 'lib/playlyfe_client/action.rb', line 8 def self.all(game) game.avaliable_actions end |
Instance Method Details
#apply_rewards_on_scores(scores) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/playlyfe_client/action.rb', line 16 def apply_rewards_on_scores(scores) new_scores=scores.dup self.rewards.each do |reward| reward[:metric].apply_reward(reward, new_scores) end new_scores end |
#play_by(player) ⇒ Object
12 13 14 |
# File 'lib/playlyfe_client/action.rb', line 12 def play_by(player) player.play(self) end |