class Tundengine::Stages::Turn

Attributes

card[R]

Public Class Methods

new(trick) click to toggle source
Calls superclass method Tundengine::Stages::Base::new
# File lib/tundengine/stages/turn.rb, line 7
def initialize(trick)
  @card = Cards::Null.instance
  super
end

Public Instance Methods

as_hash() click to toggle source
# File lib/tundengine/stages/turn.rb, line 28
def as_hash
  { player: player.name, card: card.to_s }
end
on_completed!(card, beats) click to toggle source
# File lib/tundengine/stages/turn.rb, line 23
def on_completed!(card, beats)
  @card = card
  trick.on_complete_child!(beats)
end
play!(card = Cards::Null.instance) click to toggle source
# File lib/tundengine/stages/turn.rb, line 19
def play!(card = Cards::Null.instance)
  player.play!(card)
end
player_in_round() click to toggle source
# File lib/tundengine/stages/turn.rb, line 15
def player_in_round
  player.in_round
end

Protected Instance Methods

completed?() click to toggle source
# File lib/tundengine/stages/turn.rb, line 38
def completed?
  card.exists?
end
new_child() click to toggle source
# File lib/tundengine/stages/turn.rb, line 34
def new_child
  Player::InTurn.new(self, trick.next_player)
end