+++ /dev/null
-<?php
-// Decks (fuer Cargo) allgemein
-class BaseDeckStructure extends BaseStructure {
- // Anzahl Decks
- private $numDecks = 0;
-
- // Konstruktor
- private function __construct ($class) {
- // Eltern-Konstruktor aufrufen
- parent::constructor($class);
-
- // Debug message
- if (((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) {
- $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
- __CLASS__,
- __LINE__
- ));
- }
-
- // Beschreibung setzen
- $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 <strong>%s</strong> wird für das Schiff <strong>%s</strong> konstruiert.<br />\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 <strong>%s</strong> wurde in das Schiff <strong>%s</strong> eingebaut.<br />\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.<br />\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]
-?>