public function addTile(Tile $tile)
{
$this->tiles[$tile->getId()] = $tile;
if (isset($this->tileList[$index = ($tile->z & 0xf) << 12 | ($tile->x & 0xf) << 8 | $tile->y & 0xff]) and $this->tileList[$index] !== $tile) {
$this->tileList[$index]->close();
}
$this->tileList[$index] = $tile;
if ($this->isInit) {
$this->hasChanged = true;
}
}