TODO: We should find something better than BaseFrameworkSystem as a type-hint
[shipsimu.git] / ship-simu / application / ship-simu / main / structures / extended / class_BaseUpperStructure.php
1 <?php
2 // Super structures (renamed to UpperStructure to avoid mixing it with super classes
3 class BaseUpperStructure extends BaseStructure {
4         /**
5          * Constructor for all super structures on a ship
6          */
7         private function __construct ($class) {
8                 // Eltern-Konstruktor aufrufen
9                 parent::constructor($class);
10
11                 // Debug message
12                 if (((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) {
13                         $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
14                                 __CLASS__,
15                                 __LINE__
16                         ));
17                 }
18
19                 // Beschreibung setzen
20                 $this->setPartDescr("Aufbauten");
21
22                 // Shall we clean up?
23                 if ($class == __CLASS__) {
24                         $this->removeSystemArray();
25                 }
26         }
27
28         /**
29          * Call new constructor
30          */
31         function constructor ($class) {
32                 $this->__construct($class);
33         }
34
35         /**
36          * Creates an upper(=super) structure
37          */
38         public static function createBaseUpperStructure () {
39                 // Instanz holen
40                 $upperInstance = new BaseUpperStructure (__CLASS__);
41
42                 // Debug message
43                 if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) {
44                         $upperInstance->getDebugInstance()->output(sprintf("[%s:%d] Aufbauten wird konstruiert.<br />\n",
45                                 __CLASS__,
46                                 __LINE__
47                         ));
48                 }
49
50                 // Unique-ID setzen
51                 $upperInstance->createUniqueID();
52
53                 // Return instance
54                 return $upperInstance;
55         }
56
57         /**
58          * Stub!
59          */
60         public function saveObjectToDatabase () {
61                 $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
62                         $this->__toString(),
63                         __FUNCTION__
64                 ));
65         }
66
67         /**
68          * Limits this object with an ObjectLimits instance
69          */
70         public function limitObject (ObjectLimits $limitInstance) {
71                 ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
72         }
73 }
74
75 // [EOF]
76 ?>