]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/constructions/yards/class_Shipyard.php
More renamed
[shipsimu.git] / application / ship-simu / main / constructions / yards / class_Shipyard.php
index 9b9540b5005fe79a899b2870eca0e13f6f81ea05..1959f836dc2e0906d54f2868d8f6113b5cdb1ce3 100644 (file)
@@ -3,11 +3,11 @@
  * A shipyard construction class which can be used for constructing all kinds of
  * ships.
  *
- * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @author             Roland Haeder <webmaster@shipsimu.org>
  * @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.shipsimu.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
@@ -27,10 +27,10 @@ class Shipyard extends BaseConstruction {
        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;
@@ -49,19 +49,13 @@ class Shipyard extends BaseConstruction {
                // Call parent constructor
                parent::__construct(__CLASS__);
 
-               // Set description
-               $this->setObjectDescription("Werft");
-
                // Staff-Liste/Schiffstyp-Liste erzeugen
                $this->createStaffList();
                $this->createShipTypeList();
-
-               // Generate unique ID number
-               $this->generateUniqueId();
        }
 
        // Create a shipyard and notify it about it's owner
-       public final static function createShipyardNotify (Harbor $harborInstance, $shipyardName, ShippingCompany $companyInstance) {
+       public static final function createShipyardNotify (Harbor $harborInstance, $shipyardName, ShippingCompany $companyInstance) {
                // Werft-Instanz holen
                $shipyardInstance = self::createShipyard($harborInstance, $shipyardName);
 
@@ -76,12 +70,12 @@ class Shipyard extends BaseConstruction {
        }
 
        // Create a shipyard, first we need to create a harbor
-       public final static function createShipyard (Harbor $harborInstance, $shipyardName) {
+       public static final function createShipyard (Harbor $harborInstance, $shipyardName) {
                // Instanz temporaer holen
                $shipyardInstance = new Shipyard();
 
                // Debug message
-               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine Werft mit dem Namen <strong>%s</strong> wird im Hafen <strong>%s</strong> konstruiert.<br />\n",
+               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Eine Werft mit dem Namen <strong>%s</strong> wird im Hafen <strong>%s</strong> konstruiert.",
                        __CLASS__,
                        __LINE__,
                        $shipyardName,
@@ -101,10 +95,9 @@ class Shipyard extends BaseConstruction {
 
                // Clean up a little
                $shipyardInstance->removeDraught();
-               $shipyardInstance->removeSystemArray();
 
                // Debug-Meldung
-               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> wurde gebaut.<br />\n",
+               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Die Werft <strong>%s</strong> wurde gebaut.",
                        __CLASS__,
                        __LINE__,
                        $shipyardName
@@ -116,21 +109,11 @@ 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 <strong>%s</strong> erh&auml;lt eine Arbeiterliste.<br />\n",
-                       __CLASS__,
-                       __LINE__,
-                       $this->getShipyardName()
-               ));
                $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 <strong>%s</strong> erh&auml;lt eine Typenliste.<br />\n",
-                       __CLASS__,
-                       __LINE__,
-                       $this->getShipyardName()
-               ));
                $this->shipTypeList = new FrameworkArrayObject("FakedShipTypeList");
        }
 
@@ -176,7 +159,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 <strong>%s</strong> kann bald Schiffe vom Typ <strong>%s</strong> bauen.<br />\n",
+               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft <strong>%s</strong> kann bald Schiffe vom Typ <strong>%s</strong> bauen.",
                        __CLASS__,
                        __LINE__,
                        $this->getShipyardName(),
@@ -196,7 +179,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 <strong>%s</strong> pr&uuml;ft, ob Schiffe vom Typ <strong>%s</strong> baubar sind.<br />\n",
+               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft <strong>%s</strong> pr&uuml;ft, ob Schiffe vom Typ <strong>%s</strong> baubar sind.",
                        __CLASS__,
                        __LINE__,
                        $this->getShipyardName(),
@@ -216,7 +199,7 @@ class Shipyard extends BaseConstruction {
                }
 
                // Debug message
-               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Werft <strong>%s</strong> hat die Suche nach dem Schiffstyp <strong>%s</strong> abgeschlossen.<br />\n",
+               if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Werft <strong>%s</strong> hat die Suche nach dem Schiffstyp <strong>%s</strong> abgeschlossen.",
                        __CLASS__,
                        __LINE__,
                        $this->getShipyardName(),