X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fship-simu%2Fmain%2Fconstructions%2Fyards%2Fclass_Shipyard.php;h=1959f836dc2e0906d54f2868d8f6113b5cdb1ce3;hb=4f70843ae8428f051d70ccff5bb43fc4c03dda8d;hp=641ffeed8c8ad44505fefd69862896d80f9aabb6;hpb=a76d51b4096b47436e269156547f02713d95af5b;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 641ffee..1959f83 100644
--- a/application/ship-simu/main/constructions/yards/class_Shipyard.php
+++ b/application/ship-simu/main/constructions/yards/class_Shipyard.php
@@ -1,15 +1,36 @@
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Ship-Simu Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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
\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 static final function createShipyardNotify (Harbor $harborInstance, $shipyardName, ShippingCompany $companyInstance) {
// Werft-Instanz holen
$shipyardInstance = self::createShipyard($harborInstance, $shipyardName);
@@ -63,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 %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,
@@ -88,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 %s wurde gebaut.
\n",
+ if ((defined('DEBUG_SHIPYARD')) || (defined('DEBUG_ALL'))) $shipyardInstance->debugOutput(sprintf("[%s:%d] Die Werft %s wurde gebaut.",
__CLASS__,
__LINE__,
$shipyardName
@@ -103,22 +109,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
@@ -153,11 +149,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); } @@ -168,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 %s kann bald Schiffe vom Typ %s bauen.