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");
25 * Calls the private constructor
27 * @param $class The class' name
30 public function constructor ($class) {
31 $this->__construct($class);
34 // Deckstruktur dem Schiff hinzufuegen
35 public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $deckInstance) {
36 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",
39 $deckInstance->getPartDescr(),
40 $shipInstance->getShipName()
43 // Eltern-Methode aufrufen
44 parent::addShipPartToShip($shipInstance, $deckInstance);
46 // Andere Daten uebertragen und von der Quelle loeschen
47 $this->setNumDecks($deckInstance->getNumDecks());
48 $deckInstance->removeNumDecks();
50 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",
53 $deckInstance->getPartDescr(),
54 $shipInstance->getShipName()
58 // Deckanzahl entfernen
59 public function removeNumDecks() {
60 if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gelöscht.<br />\n",
64 unset($this->numDecks);
67 // Setter-Methode fuer Anzahl Decks
68 public final function setNumDecks($numDecks) {
69 $this->numDecks = (int) $numDecks;
72 // Getter-Methode fuer Anzahl Decks
73 public final function getNumDecks() {
74 return $this->numDecks;