<?php
class Game
{
}
class Map
{
public $x = 100;
public $y = 100;
public $animals = array();
public function addAnimal(Animal $animal)
{
$this->animals[$animal->name] = $animal;
}
public function removeAnimal(Animal $animal)
{
unset($this->animals[$animal->name]); }
}
class Animal
{
public $name;
public $x;
public $y;
public function move()
{
}
}
class Cat extends Animal
{
public function eatMouse()
{
}
}
class Mouse extends Animal
{
}
PD9waHAKCm1iX2ludGVybmFsX2VuY29kaW5nKCdVVEYtOCcpOwoKY2xhc3MgR2FtZQp7Cgp9CgpjbGFzcyBNYXAKewogICAgcHVibGljICR4ID0gMTAwOwogICAgcHVibGljICR5ID0gMTAwOwogICAgcHVibGljICRhbmltYWxzID0gYXJyYXkoKTsKCiAgICBwdWJsaWMgZnVuY3Rpb24gYWRkQW5pbWFsKEFuaW1hbCAkYW5pbWFsKQogICAgewogICAgICAgICR0aGlzLT5hbmltYWxzWyRhbmltYWwtPm5hbWVdID0gJGFuaW1hbDsKICAgIH0KICAgIHB1YmxpYyBmdW5jdGlvbiByZW1vdmVBbmltYWwoQW5pbWFsICRhbmltYWwpCiAgICB7CiAgICAgICAgdW5zZXQoJHRoaXMtPmFuaW1hbHNbJGFuaW1hbC0+bmFtZV0pOwogICAgfQp9CgpjbGFzcyBBbmltYWwKewogICAgcHVibGljICRuYW1lOwogICAgcHVibGljICR4OwogICAgcHVibGljICR5OwoKICAgIHB1YmxpYyBmdW5jdGlvbiBtb3ZlKCkKICAgIHsKCiAgICB9Cn0KCmNsYXNzIENhdCBleHRlbmRzIEFuaW1hbAp7CiAgICBwdWJsaWMgZnVuY3Rpb24gZWF0TW91c2UoKQogICAgewoKICAgIH0KfQoKY2xhc3MgTW91c2UgZXh0ZW5kcyBBbmltYWwKewoKfQ==