X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fship-simu%2Fmain%2Fconstructions%2Fyards%2Fclass_Shipyard.php;h=eca03bac5af8673b8f89857abc32d75fa53d4ce2;hb=2b7c3e43b2fe0f3c5ae0455d13fa7743b638049f;hp=050f0d71bdf6a3ca9b1b86ba0413333ef7a373ec;hpb=2a157996efd680b87b0a84cc95b91619ea6e81d9;p=shipsimu.git diff --git a/application/ship-simu/main/constructions/yards/class_Shipyard.php b/application/ship-simu/main/constructions/yards/class_Shipyard.php index 050f0d7..eca03ba 100644 --- a/application/ship-simu/main/constructions/yards/class_Shipyard.php +++ b/application/ship-simu/main/constructions/yards/class_Shipyard.php @@ -5,9 +5,9 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team * @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 @@ -20,17 +20,17 @@ * 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 . + * along with this program. If not, see . */ class Shipyard extends BaseConstruction { // Werft-Name private $shipyardName = "Namenlose Werft"; // Arbeiter-Liste - private $staffList = null; + private $staffList = null; // Queue-Liste fuer zu bauende Schiffe - private $queueList = null; + private $queueList = null; // Aktuell im Bau befindliches Schiff private $currShipInConst = null; @@ -45,31 +45,17 @@ class Shipyard extends BaseConstruction { private $shippingCompany = null; // Constructor - private function __construct () { + protected function __construct () { // Call parent constructor - parent::constructor(__CLASS__); - - // Debug message - if (((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) { - $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.
\n", - __CLASS__, - __LINE__ - )); - } - - // Set description - $this->setPartDescr("Werft"); + parent::__construct(__CLASS__); // Staff-Liste/Schiffstyp-Liste erzeugen $this->createStaffList(); $this->createShipTypeList(); - - // Generate unique ID number - $this->createUniqueID(); } // Create a shipyard and notify it about it's owner - public static function createShipyardNotify (Harbor $harborInstance, $shipyardName, ShippingCompany $companyInstance) { + public final static function createShipyardNotify (Harbor $harborInstance, $shipyardName, ShippingCompany $companyInstance) { // Werft-Instanz holen $shipyardInstance = self::createShipyard($harborInstance, $shipyardName); @@ -89,7 +75,7 @@ class Shipyard extends BaseConstruction { $shipyardInstance = new Shipyard(); // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Werft mit dem Namen %s wird im Hafen %s konstruiert.
\n", + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Eine Werft mit dem Namen %s wird im Hafen %s konstruiert.", __CLASS__, __LINE__, $shipyardName, @@ -112,7 +98,7 @@ class Shipyard extends BaseConstruction { $shipyardInstance->removeSystemArray(); // Debug-Meldung - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s wurde gebaut.
\n", + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Die Werft %s wurde gebaut.", __CLASS__, __LINE__, $shipyardName @@ -124,22 +110,12 @@ class Shipyard extends BaseConstruction { // Create staff list private function createStaffList () { - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s erhält eine Arbeiterliste.
\n", - __CLASS__, - __LINE__, - $this->getShipyardName() - )); - $this->staffList = new FrameworkArrayObject(); + $this->staffList = new FrameworkArrayObject("FakedStaffList"); } // Create ship type list private function createShipTypeList () { - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s erhält eine Typenliste.
\n", - __CLASS__, - __LINE__, - $this->getShipyardName() - )); - $this->shipTypeList = new FrameworkArrayObject(); + $this->shipTypeList = new FrameworkArrayObject("FakedShipTypeList"); } // Setter-Methode fuer Werft-Name @@ -174,11 +150,6 @@ class Shipyard extends BaseConstruction { // Add new personell public function addNewPersonell ($personell) { - if (is_null($this->staffList)) { - // Opps, not initialized! - ApplicationEntryPoint::app_die("New personell:
".print_r($this, true)."
"); - } - // Add to list $this->staffList->append($personell); } @@ -189,7 +160,7 @@ class Shipyard extends BaseConstruction { $shipType = (string) $shipType; // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s kann bald Schiffe vom Typ %s bauen.
\n", + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft %s kann bald Schiffe vom Typ %s bauen.", __CLASS__, __LINE__, $this->getShipyardName(), @@ -209,7 +180,7 @@ class Shipyard extends BaseConstruction { $shipType = (string) $shipType; // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s prüft, ob Schiffe vom Typ %s baubar sind.
\n", + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft %s prüft, ob Schiffe vom Typ %s baubar sind.", __CLASS__, __LINE__, $this->getShipyardName(), @@ -229,7 +200,7 @@ class Shipyard extends BaseConstruction { } // Debug message - if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft %s hat die Suche nach dem Schiffstyp %s abgeschlossen.
\n", + if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft %s hat die Suche nach dem Schiffstyp %s abgeschlossen.", __CLASS__, __LINE__, $this->getShipyardName(), @@ -239,23 +210,6 @@ class Shipyard extends BaseConstruction { // Return result return $result; } - - /** - * Stub! - */ - public function saveObjectToDatabase () { - $this->getDebugInstance()->output(sprintf("[%s:] Stub %s erreicht.", - $this->__toString(), - __FUNCTION__ - )); - } - - /** - * Limits this object with an ObjectLimits instance - */ - public function limitObject (ObjectLimits $limitInstance) { - ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!"); - } } // [EOF]