Ejemplo n.º 1
0
 function it_uses_captured_cards_after_it_runs_out($battle)
 {
     $this->cardsCount()->shouldBe(0);
     $cards = CardsCollection::make([new Card('A', 'spades'), new Card('2', 'spades')]);
     $this->capturedCount()->shouldBe(0);
     $this->capture($cards);
     $this->capturedCount()->shouldBe(2);
     $this->playCard();
     // reloads from captured and plays
     $this->cardsCount()->shouldBe(1);
 }
Ejemplo n.º 2
0
 /**
  * Player constructor.
  *
  * @param       $name
  * @param array $cards
  */
 public function __construct($name, array $cards = [])
 {
     $this->name = $name;
     $this->cards = CardsCollection::make($cards);
     $this->captured = new CardsCollection();
 }