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