示例#1
0
 /**
  * @param Stone $stone
  */
 public function removeStone(Stone $stone)
 {
     foreach ($this->stones as $k => $playerStone) {
         if ($stone->isEqual($playerStone)) {
             unset($this->stones[$k]);
         }
     }
 }
示例#2
0
 private function assertContainsStone(Stone $stone, array $stones)
 {
     $hasStone = array_reduce($stones, function ($hasStone, Stone $other) use($stone) {
         return $hasStone || $stone->isEqual($other);
     }, false);
     $this->assertTrue($hasStone);
 }