]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/ships/class_BaseShip.php
generateUniqueId() and more useless/deprecated methods removed, code speed-up, link...
[shipsimu.git] / application / ship-simu / main / ships / class_BaseShip.php
index 51f1559d947e4b9ed1f7c300d8b9dee68230187c..bdebb6862d79fdb085ace13b79418d0db890d9d2 100644 (file)
@@ -42,15 +42,11 @@ class BaseShip extends BaseSimulator {
                // Call parent constructor
                parent::__construct($className);
 
-               // Set object description
-               $this->setObjectDescription("Allgemeines Schiff");
-
                // Prepare array object for all structures
                $this->createStructuresArray();
 
                // Clean-up a little
                $this->removePartInstance();
-               $this->removeNumberFormaters();
        }
 
        // Array-Objekt anlegen
@@ -70,13 +66,13 @@ class BaseShip extends BaseSimulator {
                ));
 
                // Ist die gewuenschte Klasse vorhanden?
-               if (class_exists($partClass)) {
-                       // Get an instance back from our object factory
-                       $partInstance = ObjectFactory::createObjectByName($partClass);
-               } else {
+               if (!class_exists($partClass)) {
                        // Nicht vorhanden, dann Ausnahme werfen!
                        throw new ClassNotFoundException($partClass, self::EXCEPTION_CLASS_NOT_FOUND);
-               }
+               } // END - if
+
+               // Get an instance back from our object factory
+               $partInstance = ObjectFactory::createObjectByName($partClass);
 
                // Das Einbauen versuchen...
                try {
@@ -127,14 +123,6 @@ class BaseShip extends BaseSimulator {
                // Instanz im Aufbauten-Array vermerken
                $this->structures->append($partInstance);
 
-               // Debug-Meldung ausgeben
-               if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat das Schiffsteil <strong>%s</strong> eingebaut bekommen.",
-                       __CLASS__,
-                       __LINE__,
-                       $this->getShipName(),
-                       $partInstance->getObjectDescription()
-               ));
-
                // Alles klar!
                return true;
        }