fork download
  1. <?php
  2.  
  3.  
  4. class Game
  5. {
  6.  
  7. }
  8.  
  9. class Map
  10. {
  11. public $x = 100;
  12. public $y = 100;
  13. public $animals = array();
  14.  
  15. public function addAnimal(Animal $animal)
  16. {
  17. $this->animals[$animal->name] = $animal;
  18. }
  19. public function removeAnimal(Animal $animal)
  20. {
  21. unset($this->animals[$animal->name]);
  22. }
  23. }
  24.  
  25. class Animal
  26. {
  27. public $name;
  28. public $x;
  29. public $y;
  30.  
  31. public function move()
  32. {
  33.  
  34. }
  35. }
  36.  
  37. class Cat extends Animal
  38. {
  39. public function eatMouse()
  40. {
  41.  
  42. }
  43. }
  44.  
  45. class Mouse extends Animal
  46. {
  47.  
  48. }
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Standard output is empty