A lot debug messages removed, mailer with stubs added, resend link basicly finished...
[shipsimu.git] / application / ship-simu / main / ships / class_BaseShip.php
index 18d2eb80da6eaf3321cfd93b6fc4b6d3413c46f3..c8079a1e96151282146a23e30d3be3074090a97d 100644 (file)
@@ -62,7 +62,7 @@ class BaseShip extends BaseSimulator {
        // buildInstance = Das was in das Schiffsteil evtl. eingebaut werden soll (null = kein besonderes Teil einbauen!)
        // partClass = Das zu konstruierende Schiffsteil
        public function createShipPart (ConstructableShipPart $buildInstance, $partClass) {
-               if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> erh&auml;lt ein neues Schiffsteil (%s).<br />\n",
+               if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> erh&auml;lt ein neues Schiffsteil (%s).",
                        __CLASS__,
                        __LINE__,
                        $this->getShipName(),
@@ -82,7 +82,7 @@ class BaseShip extends BaseSimulator {
                try {
                        $partInstance->addShipPartToShip($this, $buildInstance);
                } catch (MotorShipMismatchException $e) {
-                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keinen Motor erhalten! Grund: <strong>%s</strong><br />\n",
+                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keinen Motor erhalten! Grund: <strong>%s</strong>",
                                __CLASS__,
                                __LINE__,
                                $this->getShipName(),
@@ -90,7 +90,7 @@ class BaseShip extends BaseSimulator {
                        ));
                        return false;
                } catch (RoomShipMismatchException $e) {
-                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keinen Maschinenraum erhalten! Grund: <strong>%s</strong><br />\n",
+                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keinen Maschinenraum erhalten! Grund: <strong>%s</strong>",
                                __CLASS__,
                                __LINE__,
                                $this->getShipName(),
@@ -99,7 +99,7 @@ class BaseShip extends BaseSimulator {
                        return false;
 
                } catch (StructureShipMismatchException $e) {
-                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keine Aufbauten erhalten! Grund: <strong>%s</strong><br />\n",
+                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keine Aufbauten erhalten! Grund: <strong>%s</strong>",
                                __CLASS__,
                                __LINE__,
                                $this->getShipName(),
@@ -107,7 +107,7 @@ class BaseShip extends BaseSimulator {
                        ));
                        return false;
                } catch (CabinShipMismatchException $e) {
-                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keine Kabine erhalten! Grund: <strong>%s</strong><br />\n",
+                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat keine Kabine erhalten! Grund: <strong>%s</strong>",
                                __CLASS__,
                                __LINE__,
                                $this->getShipName(),
@@ -115,7 +115,7 @@ class BaseShip extends BaseSimulator {
                        ));
                        return false;
                } catch (DeckShipMismatchException $e) {
-                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat kein Deck erhalten! Grund: <strong>%s</strong><br />\n",
+                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat kein Deck erhalten! Grund: <strong>%s</strong>",
                                __CLASS__,
                                __LINE__,
                                $this->getShipName(),
@@ -128,7 +128,7 @@ class BaseShip extends BaseSimulator {
                $this->structures->append($partInstance);
 
                // Debug-Meldung ausgeben
-               if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat das Schiffsteil <strong>%s</strong> eingebaut bekommen.<br />\n",
+               if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das Schiff <strong>%s</strong> hat das Schiffsteil <strong>%s</strong> eingebaut bekommen.",
                        __CLASS__,
                        __LINE__,
                        $this->getShipName(),
@@ -146,69 +146,31 @@ class BaseShip extends BaseSimulator {
 
        // STUB: Getter-Methode Anzahl Betten
        public function calcTotalBeds () {
-               $this->getDebugInstance()->output("[%s:%d] Stub! Anzahl Betten erreicht.<br />\n");
-               return 0;
+               $this->partialStub("Please implement this stub in your ship!");
        }
 
        // Setter-Methode fuer Schiffsnamen
        public final function setShipName ($shipName) {
-               // Cast the string
-               $shipName = (string) $shipName;
-
-               // Debug message
-               if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das neue Schiff vom Typ <strong>%s</strong> wird auf den Namen <strong>%s</strong> getauft.<br />\n",
-                       __CLASS__,
-                       __LINE__,
-                       $this->__toString(),
-                       $shipName
-               ));
-
-               // Set ship name
-               $this->shipName = $shipName;
+               $this->shipName = (string) $shipName;
        }
 
        // Getter-Methode fuer Schiffsnamen
        public final function getShipName () {
-               if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das <strong>%s</strong> ist auf den Namen <strong>%s</strong> getauft worden.<br />\n",
-                       __CLASS__,
-                       __LINE__,
-                       $this->__toString(),
-                       $this->shipName
-               ));
                return $this->shipName;
        }
 
        // Setter-Methode fuer Tiefgang
        public final function setDraught ($draught) {
-               if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das <strong>%s</strong> mit dem Namen <strong>%s</strong> hat einen Tiefgang von <strong>%sm</strong>.<br />\n",
-                       __CLASS__,
-                       __LINE__,
-                       $this->__toString(),
-                       $this->shipName,
-                       $draught
-               ));
                $this->draught = (int) $draught;
        }
 
        // Getter-Methode fuer Tiefgang
        public final function getDraught() {
-               if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Tiefgang des Schiffes <strong>%s</strong> wurde angefordert.<br />\n",
-                       __CLASS__,
-                       __LINE__,
-                       $this->shipName
-               ));
                return $this->draught;
        }
 
        // Setter-Methode fuer Anzahl Anker
        public final function setNumAnchor ($numAnchor) {
-               if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Das <strong>%s</strong> mit dem Namen <strong>%s</strong> hat <strong>%s</strong> Anker.<br />\n",
-                       __CLASS__,
-                       __LINE__,
-                       $this->__toString(),
-                       $this->shipName,
-                       $numAnchor
-               ));
                $this->numAnchor = (int) $numAnchor;
        }
 }