TODO: We should find something better than BaseFrameworkSystem as a type-hint
[shipsimu.git] / ship-simu / application / ship-simu / main / structures / extended / decks / cargo / class_TrainDeck.php
1 <?php
2 // Decks fuer LKWs
3 class TrainDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPart {
4         // Konstruktor
5         private function __construct () {
6                 // Eltern-Konstruktor aufrufen
7                 parent::constructor(__CLASS__);
8
9                 // Debug message
10                 if (((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
11                         __CLASS__,
12                         __LINE__
13                 ));
14
15                 // Beschreibung setzen
16                 $this->setPartDescr("Zug-Deck");
17
18                 // Unique-ID erzeugen
19                 $this->createUniqueID();
20
21                 // Clean up a little
22                 $this->removeSystemArray();
23         }
24
25         // LKW-Deck erstellen
26         public static function createTrainDeck ($numDecks, $dim) {
27                 // Instanz holen
28                 $trainInstance = new TrainDeck();
29
30                 // Debug message
31                 if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $trainInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...<br />\n",
32                         __CLASS__,
33                         __LINE__
34                 ));
35
36                 // Abmasse extrahieren
37                 $trainInstance->extractDimensions($dim);
38
39                 // Andere Daten uebetragen
40                 $trainInstance->setNumDecks($numDecks);
41
42                 // Nicht noetige Instanz
43                 $trainInstance->removePartInstance();
44
45                 // Instanz zurueckliefern
46                 return $trainInstance;
47         }
48
49         // Deckanzahl entfernen
50         public function removeNumDecks() {
51                 if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gel&ouml;scht.<br />\n",
52                         __CLASS__,
53                         __LINE__
54                 ));
55                 parent::removeNumDecks();
56         }
57
58         // Setter-Methode fuer Anzahl Decks
59         public function setNumDecks ($numDecks) {
60                 parent::setNumDecks($numDecks);
61         }
62
63         // Getter-Methode fuer Anzahl Decks
64         public function getNumDecks() {
65                 return parent::getNumDecks();
66         }
67
68         // Overwritten method for tradeable items
69         public function isTradeable () {
70                 return true;
71         }
72
73         /**
74          * Limits this object with an ObjectLimits instance
75          */
76         public function limitObject (ObjectLimits $limitInstance) {
77                 ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
78         }
79 }
80
81 // [EOF]
82 ?>