TODO: We should find something better than BaseFrameworkSystem as a type-hint
[shipsimu.git] / ship-simu / application / ship-simu / main / structures / extended / cabines / ship / class_EconomyCabin.php
1 <?php
2 // Economy-Class-Kabinen
3 class EconomyCabin extends BaseCabin 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_CABIN')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) {
11                         $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
12                                 __CLASS__,
13                                 __LINE__
14                         ));
15                 }
16
17                 // Beschreibung setzen
18                 $this->setPartDescr("Economy-Class-Kabine");
19
20                 // Unique-ID erzeugen
21                 $this->createUniqueID();
22
23                 // Clean up a little
24                 $this->removeSystemArray();
25         }
26
27         // Economy-Kabine erstellen
28         public static function createEconomyCabin ($numLuxury, $numRooms, $numBeds, $dim) {
29                 // Instanz holen
30                 $ecoInstance = new EconomyCabin();
31
32                 // Debug message
33                 if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $ecoInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Economy-Class-Kabine wird konstruiert...<br />\n",
34                         __CLASS__,
35                         __LINE__
36                 ));
37
38                 // Abmasse extrahieren
39                 $ecoInstance->extractDimensions($dim);
40
41                 // Den Rest auch setzen
42                 $ecoInstance->setNumCabin($numLuxury);
43                 $ecoInstance->setNumRooms($numRooms);
44                 $ecoInstance->setNumBeds($numBeds);
45
46                 // Nicht noetig!
47                 $ecoInstance->removePartInstance();
48
49                 // Instanz zurueckgeben
50                 return $ecoInstance;
51         }
52
53         // Loesch-Methode fuer Anzahl Betten
54         public function removeNumBeds() {
55                 if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Betten gel&ouml;scht.<br />\n",
56                         __CLASS__,
57                         __LINE__
58                 ));
59                 unset($this->numBeds);
60                 parent::removeNumBeds();
61         }
62
63         // Loesch-Methode fuer Anzahl Kabinen
64         public function removeNumCabin() {
65                 if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Kabinen gel&ouml;scht.<br />\n",
66                         __CLASS__,
67                         __LINE__
68                 ));
69                 unset($this->numCabin);
70                 parent::removeNumCabin();
71         }
72
73         // Loesch-Methode fuer Anzahl Raeume
74         public function removeNumRooms() {
75                 if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl R&auml;ume gel&ouml;scht.<br />\n",
76                         __CLASS__,
77                         __LINE__
78                 ));
79                 unset($this->numRooms);
80                 parent::removeNumRooms();
81         }
82
83         // Overwritten method for tradeable items
84         public function isTradeable () {
85                 return true;
86         }
87
88         /**
89          * Limits this object with an ObjectLimits instance
90          */
91         public function limitObject (ObjectLimits $limitInstance) {
92                 ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
93         }
94 }
95
96 // [EOF]
97 ?>