setKind('animal'); } function setKind($Kind){ //! \brief set kind of object $this->kind = $Kind; } function call(){ //! \brief say the call of this animal $speigel = $this->speigel; if (isset($speigel)) $speigel = ' says "' . $speigel . '"'; else $speigel = ' '; TIO_writeln($this->kind . $speigel); } }; //! \brief an abstract bird class Bird extends Animal{ function Bird(){ //! \brief constructor $this->setKind('bird'); } }; //! \brief a subclassed bird class Pigeon extends Bird{ function Pigeon(){ //! \brief constructor $this->setKind('pigeon'); $this->speigel = 'oh my poor toe Betty'; } }; //! \brief another subclassed bird class RedKite extends Bird{ function RedKite(){ //! \brief constructor $this->setKind('red kite'); $this->speigel = 'weee-ooo ee oo ee oo ee oo'; } }; //! \brief a base mammal class Mammal extends Animal{ }; //! \brief a subclassed mammal class Cat extends Mammal{ function Cat(){ //! \brief constructor $this->setKind('cat'); $this->speigel = 'meow'; } }; //! \brief another subclassed mammal class Dog extends Mammal{ function Dog(){ //! \brief constructor $this->setKind('dog'); $this->speigel = 'woof'; } }; //eof ?>