Class: Center

Inherits:
Cards show all
Defined in:
lib/ascension/cards.rb

Instance Attribute Summary

Attributes inherited from Cards

#game, #side

Instance Method Summary collapse

Methods inherited from Cards

#<<, #[], #[]=, #clear!, #each, #empty?, #first, #get_one, #hydrate!, #include?, #index, #pop, #shuffle!, #size, #to_s_cards

Instance Method Details

#banish(card) ⇒ Object



159
160
161
162
# File 'lib/ascension/cards.rb', line 159

def banish(card)
  super
  fill!
end

#fill!Object



142
143
144
145
146
147
148
149
150
151
152
# File 'lib/ascension/cards.rb', line 142

def fill!
  (0...size).each do |i|
    if self[i].name == 'Dummy'
      self[i] = game.deck.pop
    end
  end

  while size < 6
    self << game.deck.pop
  end
end

#remove(c) ⇒ Object



153
154
155
156
157
158
# File 'lib/ascension/cards.rb', line 153

def remove(c)
  raise "#{c} not here" unless include?(c)
  i = index(c)
  self[i] = Card.dummy
  fill!
end