예제 #1
0
 public function addTile(Tile $tile, $distance = 0)
 {
     $coreIsNotYetBuilt = !$this->coreIsBuilt;
     if ($coreIsNotYetBuilt) {
         $this->tiles[] = [$tile->getCoordinates(), $distance];
     } else {
         throw new LittleMapCannotGrowException();
     }
 }
예제 #2
0
 public function testJson()
 {
     $tile = new Tile();
     $this->assertEquals(['x' => 0, 'y' => 0], $tile->jsonSerialize());
 }