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