]> git.mxchange.org Git - shipsimu.git/commitdiff
interface added to setter
authorRoland Häder <roland@mxchange.org>
Sat, 8 Mar 2008 12:18:03 +0000 (12:18 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 8 Mar 2008 12:18:03 +0000 (12:18 +0000)
application/ship-simu/main/class_BaseSimulator.php

index 4726d299649a89ea2c9a049517a819d5fca149dd..a63ce111f1bd250c1033b3168db9c6f2a3519495 100644 (file)
@@ -62,7 +62,7 @@ class BaseSimulator extends BaseFrameworkSystem {
        }
 
        // Setter-Methode fuer Laenge
-       public function setLength ($length) {
+       public final function setLength ($length) {
                if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] <strong>%dm</strong> L&auml;nge gesetzt.<br />\n",
                        $this->__toString(),
                        $length
@@ -71,7 +71,7 @@ class BaseSimulator extends BaseFrameworkSystem {
        }
 
        // Setter-Methode fuer Breite
-       public function setWidth ($width) {
+       public final function setWidth ($width) {
                if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] <strong>%dm</strong> Breite gesetzt.<br />\n",
                        $this->__toString(),
                        $width
@@ -80,7 +80,7 @@ class BaseSimulator extends BaseFrameworkSystem {
        }
 
        // Setter-Methode fuer Hoehe
-       public function setHeight ($height) {
+       public final function setHeight ($height) {
                if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] <strong>%dm</strong> H&ouml;he gesetzt.<br />\n",
                        $this->__toString(),
                        $height
@@ -89,7 +89,7 @@ class BaseSimulator extends BaseFrameworkSystem {
        }
 
        // Getter-Methode fuer Laenge
-       public function getLength () {
+       public final function getLength () {
                if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] L&auml;nge angefordert.<br />\n",
                        $this->__toString()
                ));
@@ -97,7 +97,7 @@ class BaseSimulator extends BaseFrameworkSystem {
        }
 
        // Getter-Methode fuer Breite
-       public function getWidth () {
+       public final function getWidth () {
                if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] L&auml;nge angefordert.<br />\n",
                        $this->__toString()
                ));
@@ -105,7 +105,7 @@ class BaseSimulator extends BaseFrameworkSystem {
        }
 
        // Getter-Methode fuer Hoehe
-       public function getHeight () {
+       public final function getHeight () {
                if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] H&ouml;he angefordert.<br />\n",
                        $this->__toString()
                ));
@@ -113,12 +113,12 @@ class BaseSimulator extends BaseFrameworkSystem {
        }
 
        // Setter-Methode fuer Teil-Instanz
-       public function setPartInstance ($struct) {
-               $this->partInstance = (Object) $struct;
+       public final function setPartInstance (ConstructableShipPart $partInstance) {
+               $this->partInstance = $partInstance;
        }
 
        // Getter-Methode fuer Teil-Instanz
-       public function getPartInstance () {
+       public final function getPartInstance () {
                if (!isset($this->partInstance)) {
                        return null;
                }
@@ -335,18 +335,18 @@ class BaseSimulator extends BaseFrameworkSystem {
                return (
                        (
                                ( // Already defined ship messurings
-                                          ($this->currPart->getWidth()  < $this->currShip->getWidth())
+                                                ($this->currPart->getWidth()  < $this->currShip->getWidth())
                                        && ($this->currPart->getHeight() < $this->currShip->getDraught())
                                        && ($this->currPart->getLength() < $this->currShip->getLength())
                                ) || ( // Ship messurings shall be calculated
-                                          ($this->currShip->getWidth()  == 0)
+                                                ($this->currShip->getWidth()  == 0)
                                        && ($this->currShip->getHeight() == 0)
                                        && ($this->currShip->getLength() == 0)
                                )
                        // The inserted part must be messured!
                        ) && ($this->currPart->getWidth()  > 0)
-                         && ($this->currPart->getHeight() > 0)
-                         && ($this->currPart->getLength() > 0)
+                               && ($this->currPart->getHeight() > 0)
+                               && ($this->currPart->getLength() > 0)
                );
        }
 
@@ -357,11 +357,11 @@ class BaseSimulator extends BaseFrameworkSystem {
                ));
                return (
                        ( // Already defined ship messurings
-                                  ($this->newWidth  < $this->currShip->getWidth())
+                                        ($this->newWidth  < $this->currShip->getWidth())
                                && ($this->newHeight < $this->currShip->getDraught())
                                && ($this->newLength < $this->currShip->getLength())
                        ) || ( // Ship messurings shall be calculated
-                                  ($this->currShip->getWidth()  == 0)
+                                        ($this->currShip->getWidth()  == 0)
                                && ($this->currShip->getHeight() == 0)
                                && ($this->currShip->getLength() == 0)
                        )