New interface SignableContract introduced, some comments translated
[shipsimu.git] / application / ship-simu / main / drives / motor / class_Motor.php
1 <?php
2
3 // Motorisierter Antrieb
4 class Motor extends BaseDrive implements ItemIsTradeable, ConstructableShipPart {
5         // Constructor
6         private function __construct() {
7                 // Call parent constructor
8                 parent::constructor(__CLASS__);
9
10                 // Debug message
11                 if (((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) {
12                         $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
13                                 __CLASS__,
14                                 __LINE__
15                         ));
16                 }
17
18                 // Set description
19                 $this->setPartDescr("Namenloser Motor");
20
21                 // Generate unique ID number
22                 $this->createUniqueID();
23
24                 // Clean up a little
25                 $this->removeSystemArray();
26         }
27
28         // Einen Motor erstellen
29         public static function createMotor ($descr, $hp, $cams, $w, $h, $l) {
30                 // Instanz holen
31                 $motorInstance = new Motor();
32
33                 // Debug message
34                 if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $motorInstance->getDebugInstance()->output(sprintf("[%s:%d] Motor <strong>%s</strong> wird gebaut...<br />\n",
35                         __CLASS__,
36                         __LINE__,
37                         $descr
38                 ));
39
40                 // Beschreibung und Abmasse setzen
41                 $motorInstance->setPartDescr($descr);
42                 $motorInstance->setWidth($w);
43                 $motorInstance->setHeight($h);
44                 $motorInstance->setLength($l);
45
46                 // Weitere Daten setzen
47                 $motorInstance->setHorsePower($hp);
48                 $motorInstance->setNumCams($cams);
49
50                 // Instanz zurueckgeben
51                 return $motorInstance;
52         }
53
54         // Overwritten method for tradeable items
55         public function isTradeable () {
56                 return true;
57         }
58
59         /**
60          * Stub!
61          */
62         public function saveObjectToDatabase () {
63                 $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
64                         $this->__toString(),
65                         __FUNCTION__
66                 ));
67         }
68
69         /**
70          * Limits this object with an ObjectLimits instance
71          */
72         public function limitObject (ObjectLimits $limitInstance) {
73                 ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
74         }
75 }
76
77 // [EOF]
78 ?>