]> git.mxchange.org Git - shipsimu.git/blobdiff - ship-simu/application/ship-simu/main/drives/motor/class_Motor.php
Initial import of current development status
[shipsimu.git] / ship-simu / application / ship-simu / main / drives / motor / class_Motor.php
diff --git a/ship-simu/application/ship-simu/main/drives/motor/class_Motor.php b/ship-simu/application/ship-simu/main/drives/motor/class_Motor.php
new file mode 100644 (file)
index 0000000..0af6b97
--- /dev/null
@@ -0,0 +1,78 @@
+<?php
+
+// Motorisierter Antrieb
+class Motor extends BaseDrive implements ItemIsTradeable, ConstructableShipPart {
+       // Constructor
+       private function __construct() {
+               // Eltern-Konstruktor aufrufen
+               parent::constructor(__CLASS__);
+
+               // Debug message
+               if (((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) {
+                       $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
+                               __CLASS__,
+                               __LINE__
+                       ));
+               }
+
+               // Beschreibung setzen
+               $this->setPartDescr("Namenloser Motor");
+
+               // Unique-ID erzeugen
+               $this->createUniqueID();
+
+               // Clean up a little
+               $this->removeSystemArray();
+       }
+
+       // Einen Motor erstellen
+       public static function createMotor ($descr, $hp, $cams, $w, $h, $l) {
+               // Instanz holen
+               $motorInstance = new Motor();
+
+               // Debug message
+               if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $motorInstance->getDebugInstance()->output(sprintf("[%s:%d] Motor <strong>%s</strong> wird gebaut...<br />\n",
+                       __CLASS__,
+                       __LINE__,
+                       $descr
+               ));
+
+               // Beschreibung und Abmasse setzen
+               $motorInstance->setPartDescr($descr);
+               $motorInstance->setWidth($w);
+               $motorInstance->setHeight($h);
+               $motorInstance->setLength($l);
+
+               // Weitere Daten setzen
+               $motorInstance->setHorsePower($hp);
+               $motorInstance->setNumCams($cams);
+
+               // Instanz zurueckgeben
+               return $motorInstance;
+       }
+
+       // Overwritten method for tradeable items
+       public function isTradeable () {
+               return true;
+       }
+
+       /**
+        * Stub!
+        */
+       public function saveObjectToDatabase () {
+               $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
+                       $this->__toString(),
+                       __FUNCTION__
+               ));
+       }
+
+       /**
+        * Limits this object with an ObjectLimits instance
+        */
+       public function limitObject (ObjectLimits $limitInstance) {
+               ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
+       }
+}
+
+// [EOF]
+?>