2 // Decks (fuer Cargo) allgemein
3 class BaseDeckStructure extends BaseStructure {
8 private function __construct ($class) {
9 // Call parent constructor
10 parent::constructor($class);
13 if (((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) {
14 $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
21 $this->setPartDescr("Deckstruktur");
24 // Konstruktor aufrufen
25 public function constructor ($class) {
26 $this->__construct($class);
29 // Deckstruktur dem Schiff hinzufuegen
30 public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $deckInstance) {
31 if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck <strong>%s</strong> wird für das Schiff <strong>%s</strong> konstruiert.<br />\n",
34 $deckInstance->getPartDescr(),
35 $shipInstance->getShipName()
38 // Eltern-Methode aufrufen
39 parent::addShipPartToShip($shipInstance, $deckInstance);
41 // Andere Daten uebertragen und von der Quelle loeschen
42 $this->setNumDecks($deckInstance->getNumDecks());
43 $deckInstance->removeNumDecks();
45 if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Deck <strong>%s</strong> wurde in das Schiff <strong>%s</strong> eingebaut.<br />\n",
48 $deckInstance->getPartDescr(),
49 $shipInstance->getShipName()
53 // Deckanzahl entfernen
54 public function removeNumDecks() {
55 if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gelöscht.<br />\n",
59 unset($this->numDecks);
62 // Setter-Methode fuer Anzahl Decks
63 public function setNumDecks($numDecks) {
64 $this->numDecks = (int) $numDecks;
67 // Getter-Methode fuer Anzahl Decks
68 public function getNumDecks() {
69 return $this->numDecks;