73207e559c8526d6fe6e382c77e526a90923b39c
[shipsimu.git] / application / ship-simu / main / structures / extended / decks / cargo / class_TruckDeck.php
1 <?php
2 // Decks fuer LKWs
3 class TruckDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPart {
4         // Konstruktor
5         private function __construct () {
6                 // Call parent constructor
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                 // Set description
16                 $this->setPartDescr("LKW-Deck");
17
18                 // Generate unique ID number
19                 $this->createUniqueID();
20
21                 // Clean up a little
22                 $this->removeSystemArray();
23         }
24
25         // LKW-Deck erstellen
26         public static function createTruckDeck ($numDecks, $dim) {
27                 // Get new instance
28                 $truckInstance = new TruckDeck();
29
30                 // Debug message
31                 if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $truckInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...<br />\n",
32                         __CLASS__,
33                         __LINE__
34                 ));
35
36                 // Abmasse extrahieren
37                 $truckInstance->extractDimensions($dim);
38
39                 // Andere Daten uebetragen
40                 $truckInstance->setNumDecks($numDecks);
41
42                 // Nicht noetige Instanz
43                 $truckInstance->removePartInstance();
44
45                 // Instanz zurueckliefern
46                 return $truckInstance;
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 final function setNumDecks ($numDecks) {
60                 parent::setNumDecks($numDecks);
61         }
62
63         // Getter-Methode fuer Anzahl Decks
64         public final 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 ?>