'final' operator fixed, uncessary methods removed
[shipsimu.git] / application / ship-simu / main / structures / extended / decks / cargo / class_TruckDeck.php
1 <?php
2 /**
3  * A truck and bus decks. Also other vehicle may be put in here if they don't
4  * match into the car deck.
5  *
6  * @author              Roland Haeder <webmaster@ship-simu.org>
7  * @version             0.0.0
8  * @copyright   Copyright(c) 2007, 2008 Roland Haeder, this is free software
9  * @license             GNU GPL 3.0 or any newer version
10  * @link                http://www.ship-simu.org
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
24  */
25 class TruckDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPart {
26         // Konstruktor
27         private function __construct () {
28                 // Call parent constructor
29                 parent::constructor(__CLASS__);
30
31                 // Debug message
32                 if (((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
33                         __CLASS__,
34                         __LINE__
35                 ));
36
37                 // Set description
38                 $this->setPartDescr("LKW-Deck");
39
40                 // Generate unique ID number
41                 $this->createUniqueID();
42
43                 // Clean up a little
44                 $this->removeSystemArray();
45         }
46
47         // LKW-Deck erstellen
48         public static function createTruckDeck ($numDecks, $dim) {
49                 // Get new instance
50                 $truckInstance = new TruckDeck();
51
52                 // Debug message
53                 if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $truckInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein LKW-Deck wird konstruiert...<br />\n",
54                         __CLASS__,
55                         __LINE__
56                 ));
57
58                 // Abmasse extrahieren
59                 $truckInstance->extractDimensions($dim);
60
61                 // Andere Daten uebetragen
62                 $truckInstance->setNumDecks($numDecks);
63
64                 // Nicht noetige Instanz
65                 $truckInstance->removePartInstance();
66
67                 // Instanz zurueckliefern
68                 return $truckInstance;
69         }
70
71         // Deckanzahl entfernen
72         public function removeNumDecks() {
73                 if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Decks wurde gel&ouml;scht.<br />\n",
74                         __CLASS__,
75                         __LINE__
76                 ));
77                 parent::removeNumDecks();
78         }
79
80         // Overwritten method for tradeable items
81         public function isTradeable () {
82                 return true;
83         }
84
85         /**
86          * Limits this object with an ObjectLimits instance
87          */
88         public function limitObject (ObjectLimits $limitInstance) {
89                 ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
90         }
91 }
92
93 // [EOF]
94 ?>