Class: PlayerDeck
Instance Attribute Summary
Attributes inherited from Cards
#game, #side
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Cards
#<<, #[], #[]=, #banish, #clear!, #each, #empty?, #first, #get_one, #hydrate!, #include?, #index, #pop, #remove, #shuffle!, #size, #to_s_cards
Class Method Details
.starting(ops = {}) ⇒ Object
78
79
80
81
82
83
84
|
# File 'lib/ascension/cards.rb', line 78
def self.starting(ops={})
res = new(ops)
8.times { res << Card::Hero.apprentice }
2.times { res << Card::Hero.militia }
res.shuffle!
res
end
|
Instance Method Details
69
70
71
72
|
# File 'lib/ascension/cards.rb', line 69
def draw_one
fill_from_discard! if empty?
cards.pop
end
|
#fill_from_discard! ⇒ Object
73
74
75
76
77
|
# File 'lib/ascension/cards.rb', line 73
def fill_from_discard!
self.cards = side.discard.cards
side.discard.cards = []
shuffle!
end
|