]> git.mxchange.org Git - shipsimu.git/blobdiff - ship-simu/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php
Initial import of current development status
[shipsimu.git] / ship-simu / application / ship-simu / main / structures / extended / decks / cargo / class_TrainDeck.php
diff --git a/ship-simu/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php b/ship-simu/application/ship-simu/main/structures/extended/decks/cargo/class_TrainDeck.php
new file mode 100644 (file)
index 0000000..840c1aa
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+// Decks fuer LKWs
+class TrainDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPart {
+       // Konstruktor
+       private function __construct () {
+               // Eltern-Konstruktor aufrufen
+               parent::constructor(__CLASS__);
+
+               // Debug message
+               if (((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
+                       __CLASS__,
+                       __LINE__
+               ));
+
+               // Beschreibung setzen
+               $this->setPartDescr("Zug-Deck");
+
+               // Unique-ID erzeugen
+               $this->createUniqueID();
+
+               // Clean up a little
+               $this->removeSystemArray();
+       }
+
+       // LKW-Deck erstellen
+       public static function createTrainDeck ($numDecks, $dim) {
+               // Instanz holen
+               $trainInstance = new TrainDeck();
+
+               // Debug message
+               if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $trainInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...<br />\n",
+                       __CLASS__,
+                       __LINE__
+               ));
+
+               // Abmasse extrahieren
+               $trainInstance->extractDimensions($dim);
+
+               // Andere Daten uebetragen
+               $trainInstance->setNumDecks($numDecks);
+
+               // Nicht noetige Instanz
+               $trainInstance->removePartInstance();
+
+               // Instanz zurueckliefern
+               return $trainInstance;
+       }
+
+       // Deckanzahl entfernen
+       public function removeNumDecks() {
+               if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gel&ouml;scht.<br />\n",
+                       __CLASS__,
+                       __LINE__
+               ));
+               parent::removeNumDecks();
+       }
+
+       // Setter-Methode fuer Anzahl Decks
+       public function setNumDecks ($numDecks) {
+               parent::setNumDecks($numDecks);
+       }
+
+       // Getter-Methode fuer Anzahl Decks
+       public function getNumDecks() {
+               return parent::getNumDecks();
+       }
+
+       // Overwritten method for tradeable items
+       public function isTradeable () {
+               return true;
+       }
+
+       /**
+        * Limits this object with an ObjectLimits instance
+        */
+       public function limitObject (ObjectLimits $limitInstance) {
+               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
+       }
+}
+
+// [EOF]
+?>