class Shithead::Player

Attributes

hand[R]
hidden[R]
name[R]
visible[R]

Public Class Methods

new(name) click to toggle source
# File lib/shithead/player.rb, line 4
def initialize(name)
  @name    = name
  @hidden  = []
  @visible = Shithead::SortedStack.new
  @hand    = Shithead::SortedStack.new
end

Public Instance Methods

add(card) click to toggle source
# File lib/shithead/player.rb, line 11
def add(card)
  hand.add card
end
clear?() click to toggle source
# File lib/shithead/player.rb, line 15
def clear?
  hidden.empty? && visible.empty? && hand.empty?
end
hand_count() click to toggle source
# File lib/shithead/player.rb, line 19
def hand_count
  hand.length
end
hidden_count() click to toggle source
# File lib/shithead/player.rb, line 23
def hidden_count
  hidden.length
end