]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/constructions/harbors/class_Harbor.php
A lot debug messages removed, mailer with stubs added, resend link basicly finished...
[shipsimu.git] / application / ship-simu / main / constructions / harbors / class_Harbor.php
index ce273ad58f3143f9ebfc2e4b5f3ad708130d6f10..31781661b0ad5cc779a5e90571a4b00d99b2198d 100644 (file)
@@ -6,7 +6,7 @@
  * @version            0.0.0
  * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
  * @license            GNU GPL 3.0 or any newer version
- * @link               http://www.ship-simu.org
+ * @link               http://www.ship-simu.org
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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 Harbor extends BaseConstruction {
        // Namen des Hafens (z.B. Hamburger Hafen)
@@ -35,18 +35,15 @@ class Harbor extends BaseConstruction {
        private $shipyardList = null;
 
        // Constructor
-       private function __construct () {
+       protected function __construct () {
                // Call parent constructor
-               parent::constructor(__CLASS__);
-
-               // Debug message
-               if (((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) $this->getDebugInstance()->output("[Harbor:] Konstruktor erreicht.<br />\n");
+               parent::__construct(__CLASS__);
 
                // Set description
-               $this->setPartDescr("Hafen");
+               $this->setObjectDescription("Hafen");
 
                // Generate unique ID number
-               $this->createUniqueID();
+               $this->generateUniqueId();
 
                // Clean up a little
                $this->removeSystemArray();
@@ -54,12 +51,12 @@ class Harbor extends BaseConstruction {
        }
 
        // Creates a harbor
-       public static function createHarbor ($harborName) {
+       public final static function createHarbor ($harborName) {
                // Hafen-Instanz holen
                $harborInstance = new Harbor();
 
                // Debug message
-               if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen <strong>%s</strong> wird konstruiert.<br />\n", $harborName));
+               if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen <strong>%s</strong> wird konstruiert.", $harborName));
 
                // Hafenname setzen
                $harborInstance->setHarborName($harborName);
@@ -68,7 +65,7 @@ class Harbor extends BaseConstruction {
                $harborInstance->createshipyardList();
 
                // Debug-Meldung ausgeben
-               if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen <strong>%s</strong> ist jetzt fertig gebaut.<br />\n", $harborName));
+               if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $harborInstance->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen <strong>%s</strong> ist jetzt fertig gebaut.", $harborName));
 
                // Instanz zurueckliefern
                return $harborInstance;
@@ -76,60 +73,30 @@ class Harbor extends BaseConstruction {
 
        // Werft-Liste generieren
        public function createshipyardList () {
-               if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Werft-Liste wird f&uuml;r den Hafen <strong>%s</strong> erstellt.<br />\n",
-                       $this->getHarborName()
-               ));
-               $this->shipyardList = new FrameworkArrayObject();
+               $this->shipyardList = new FrameworkArrayObject("FakedShipyardList");
        }
 
        // Setter fuer Hafennamen
        public final function setHarborName ($harborName) {
-               if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Der Hafen heisst jetzt <strong>%s</strong>.<br />\n", $harborName));
                $this->harborName = (string) $harborName;
        }
 
        // Getter fuer Hafennamen
        public final function getHarborName () {
-               if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Hafenname <strong>%s</strong> wurde angefordert.<br />\n", $this->harborName));
                return $this->harborName;
        }
 
        // Werft in den Hafen einbauen und Werft->Reederei zuweisen
        public function addNewShipyardNotify ($shipyardName, ShippingCompany $companyInstance) {
-               if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Die Werft <strong>%s</strong> wird im Hafen <strong>%s</strong> gebaut.<br />\n",
-                       $shipyardName, $this->getHarborName()
-               ));
-
                // Werft generieren und in die Werftliste aufnehmen
                $this->shipyardList->append(Shipyard::createShipyardNotify($this, $shipyardName, $companyInstance));
        }
 
        // Werft in den Hafen einbauen ohne Zuweisung einer Reederei (gehoert der "Stadt" dann)
        public function addNewShipyard ($shipyardName) {
-               if ((defined('DEBUG_HARBOR')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[Harbor:] Die Werft <strong>%s</strong> wird im Hafen <strong>%s</strong> gebaut.<br />\n",
-                       $shipyardName, $this->getHarborName()
-               ));
-
                // Werft generieren und in die Werftliste aufnehmen
                $this->shipyardList->append(Shipyard::createShipyard($this, $shipyardName));
        }
-
-       /**
-        * 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]