getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.
\n",
__CLASS__,
__LINE__
));
}
// Set description
$this->setPartDescr("Deckstruktur");
}
// Konstruktor aufrufen
public function constructor ($class) {
$this->__construct($class);
}
// Deckstruktur dem Schiff hinzufuegen
public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $deckInstance) {
if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck %s wird für das Schiff %s konstruiert.
\n",
__CLASS__,
__LINE__,
$deckInstance->getPartDescr(),
$shipInstance->getShipName()
));
// Eltern-Methode aufrufen
parent::addShipPartToShip($shipInstance, $deckInstance);
// Andere Daten uebertragen und von der Quelle loeschen
$this->setNumDecks($deckInstance->getNumDecks());
$deckInstance->removeNumDecks();
if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck %s wurde in das Schiff %s eingebaut.
\n",
__CLASS__,
__LINE__,
$deckInstance->getPartDescr(),
$shipInstance->getShipName()
));
}
// Deckanzahl entfernen
public function removeNumDecks() {
if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gelöscht.
\n",
__CLASS__,
__LINE__
));
unset($this->numDecks);
}
// Setter-Methode fuer Anzahl Decks
public function setNumDecks($numDecks) {
$this->numDecks = (int) $numDecks;
}
// Getter-Methode fuer Anzahl Decks
public function getNumDecks() {
return $this->numDecks;
}
}
// [EOF]
?>