Method constructor() removed, several small fixes
[shipsimu.git] / application / ship-simu / main / class_BaseSimulator.php
index ec3fe30f342500500b6c8b66f9c16b27451f66a2..0ca7a91662427f2ac832a80e48b8a89e3e066708 100644 (file)
@@ -19,7 +19,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 class BaseSimulator extends BaseFrameworkSystem {
        // Schiffsteilinstanz
@@ -42,16 +42,16 @@ class BaseSimulator extends BaseFrameworkSystem {
        );
 
        // Konstruktor
-       private function __construct ($class) {
+       protected function __construct ($class) {
                // Call highest constructor
-               parent::constructor($class);
+               parent::__construct($class);
 
                if ((defined('DEBUG_CORE')) && (defined('DEBUG_CONSTRUCT'))) $this->getDebugInstance()->output(sprintf("[%s:] Konstruktor erreicht.<br />\n",
                        $this->__toString()
                ));
 
                // Set part description and class name
-               $this->setPartDescr("Simulator-Basis-Einheit");
+               $this->setObjectDescription("Simulator-Basis-Einheit");
 
                // Clean up a little, dies sollte ganz zum Schluss erfolgen!
                $this->removeResizeFactorArray();
@@ -59,28 +59,6 @@ class BaseSimulator extends BaseFrameworkSystem {
                $this->removeCurrShip();
        }
 
-       // Public constructor
-       public function constructor ($class) {
-               // Call real constructor
-               $this->__construct($class);
-       }
-
-       // Magic __isset method
-       private function __isset ($var) {
-               if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Checking <strong>%s</strong> in class.<br />\n",
-                       $this->__toString(), $var
-               ));
-               return isset($this->$var);
-       }
-
-       // Magic __unset method
-       private function __unset($var) {
-               if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Removing <strong>%s</strong> from class.<br />\n",
-                       $this->__toString(), $var
-               ));
-               unset($this->$var);
-       }
-
        // Setter-Methode fuer Laenge
        public final function setLength ($length) {
                if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] <strong>%dm</strong> L&auml;nge gesetzt.<br />\n",
@@ -177,7 +155,7 @@ class BaseSimulator extends BaseFrameworkSystem {
 
                if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Maschinenraum mit Motor <strong>%s</strong> wird fuer das Schiff <strong>%s</strong> konstruiert.<br />\n",
                        $this->__toString(),
-                       $this->getCurrPart()->getPartDescr(),
+                       $this->getCurrPart()->getObjectDescription(),
                        $this->currShip->getShipName()
                ));
 
@@ -186,7 +164,7 @@ class BaseSimulator extends BaseFrameworkSystem {
                        // Berechnungen fuer umliegendes Objekt anpassen
                        if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Das Schiffsteil <strong>%s</strong> vom Typ <strong>%s</strong> passt in das Schiff <strong>%s</strong> hinein.<br />\n",
                                $this->__toString(),
-                               $this->getCurrPart()->getPartDescr(),
+                               $this->getCurrPart()->getObjectDescription(),
                                $this->getCurrPart()->__toString(),
                                $this->currShip->getShipName()
                        ));
@@ -203,7 +181,7 @@ class BaseSimulator extends BaseFrameworkSystem {
                                        // Das passt auch, dann Werte setzen und Motor-Instanz merken
                                        if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Das Schiffsteil <strong>%s</strong> passt in das Schiff <strong>%s</strong> hinein.<br />\n",
                                                $this->__toString(),
-                                               $this->getPartDescr(),
+                                               $this->getObjectDescription(),
                                                $this->currShip->getShipName()
                                        ));
                                        $this->setWidth($this->newWidth);
@@ -216,7 +194,7 @@ class BaseSimulator extends BaseFrameworkSystem {
                                        // Passt nicht! Also wieder Exception werfen...
                                        throw new StructureShipMismatchException(sprintf("[%s:] Das Schiffsteil <strong>%s</strong> vom Typ <strong>%s</strong> ist zu gross f&uuml;r das Schiff!",
                                                $this->getCurrPart()->__toString(),
-                                               $this->getCurrPart()->getPartDescr(),
+                                               $this->getCurrPart()->getObjectDescription(),
                                                $this->getCurrPart()->__toString()
                                        ), 2);
                                }
@@ -232,7 +210,7 @@ class BaseSimulator extends BaseFrameworkSystem {
                                // Debug-Meldung ausgeben
                                if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Schiffsteil <strong>%s</strong> gefunden.<br />\n",
                                        $this->getCurrPart()->realClass,
-                                       $this->getCurrPart()->getPartDescr()
+                                       $this->getCurrPart()->getObjectDescription()
                                ));
 
                                // Schiffsteil-Instanz setzen
@@ -248,7 +226,7 @@ class BaseSimulator extends BaseFrameworkSystem {
                        // Exception werfen!
                        throw new StructureShipMismatchException(sprintf("[%s:] Das Schiffsteil <u>%s</u> vom Typ <u>%s</u> passt nicht in das Schiff!",
                                $this->getCurrPart()->realClass,
-                               $this->getCurrPart()->getPartDescr(),
+                               $this->getCurrPart()->getObjectDescription(),
                                $this->getCurrPart()->__toString()
                        ), 1);
                }
@@ -400,7 +378,7 @@ class BaseSimulator extends BaseFrameworkSystem {
        public function extractDimensions ($dim) {
                if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] extractDimensions erreicht f&uuml;r <strong>%s</strong>.<br />\n",
                        $this->__toString(),
-                       $this->getPartDescr()
+                       $this->getObjectDescription()
                ));
 
                // Abmasse setzen