* @return void
* @see LanguageSystem
*/
- public function setLanguageInstance (ManageableLanguage $langInstance) {
+ public final function setLanguageInstance (ManageableLanguage $langInstance) {
$this->langInstance = $langInstance;
}
* @param $fileIOInstance An instance to the file I/O sub-system
* @return void
*/
- public function setFileIOInstance (FileIOHandler $fileIOInstance) {
+ public final function setFileIOInstance (FileIOHandler $fileIOInstance) {
$this->fileIOInstance = $fileIOInstance;
}
// You can prevent adding this application to the selector by uncommenting the
// following line:
//
-// if ((isset($this)) && (is_object($this)) && ($this->isClass("ApplicationSelector"))) { return; }
+// if ((isset($this)) && (is_object($this)) && ($this->isSameClass("ApplicationSelector"))) { return; }
//
// isset() is required to prevent a warning and is_object() is highly required
// when the application itself is requested in URL (hint: index.php?app=your_app)
}
// Getter for surname
- public function getSurname () {
+ public final function getSurname () {
return $this->surname;
}
}
// Remove gender
- public function removeGender () {
+ public final function removeGender () {
unset($this->gender);
}
// Remove both names
- public function removeNames () {
+ public final function removeNames () {
unset($this->surname);
unset($this->family);
}
// Remove complete birthday
- public function removeBirthday () {
+ public final function removeBirthday () {
unset($this->yearBirth);
unset($this->monthBirth);
unset($this->dayBirth);
}
// Remove salary
- public function removeSalary () {
+ public final function removeSalary () {
unset($this->salary);
}
// Remove employment status
- public function removeEmployed () {
+ public final function removeEmployed () {
unset($this->employed);
}
// Remove marrital status
- public function removeMarried () {
+ public final function removeMarried () {
unset($this->married);
}
}
// Set part description and class name
$this->setPartDescr("Simulator-Basis-Einheit");
- // Etwas aufraeumen, dies sollte ganz zum Schluss erfolgen!
+ // Clean up a little, dies sollte ganz zum Schluss erfolgen!
$this->removeResizeFactorArray();
$this->removeCurrPart();
$this->removeCurrShip();
), 1);
}
- // Nochmals etwas aufraeumen
+ // Nochmals Clean up a little
$this->removeResizeFactorArray();
$this->removeCurrShip();
$this->removeCurrPart();
}
// Getter-Methode fuer Element aus resizeFactor
- public function getResizeFactorElement ($el) {
+ public final function getResizeFactorElement ($el) {
if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] getResizeFactorElement erreicht. (element=%s)<br />\n",
$this->__toString(),
$el
}
// Setter-Methode fuer Element in resizeFactor
- public function setResizeFactorElement ($el, $value) {
+ public final function setResizeFactorElement ($el, $value) {
if (defined('DEBUG_CORE')) $this->getDebugInstance()->output(sprintf("[%s:] Umberechnungsfaktor <strong>%s</strong>=<strong>%s</strong> gesetzt.<br />\n",
$this->__toString(),
$el,
// String absichern
$merchantName = (string) $merchantName;
- // Instanz holen
+ // Get new instance
$merchantInstance = new Merchant();
// Debug message
}
// Setter for merchant name
- public function setMerchantName ($merchantName) {
+ public final function setMerchantName ($merchantName) {
// Secure string
$merchantName = (string) $merchantName;
}
// Getter for merchant name
- public function getMerchantName () {
+ public final function getMerchantName () {
if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händlername <strong>%s</strong> wird verlangt.<br />\n",
__CLASS__,
__LINE__,
}
// Setter for harbor instance
- public function setHarborInstance (Harbor $harborInstance) {
+ public final function setHarborInstance (Harbor $harborInstance) {
if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler <strong>%s</strong> lässt sich am <strong>%s</strong> nieder.<br />\n",
__CLASS__,
__LINE__,
}
// Getter for harbor instance
- public function getHarborInstance () {
+ public final function getHarborInstance () {
if ((defined('DEBUG_MERCHANT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Der Händler <strong>%s</strong> hat sich am <strong>%s</strong> niedergelassen.<br />\n",
__CLASS__,
__LINE__,
}
// Get a price from the merchant's list
- public function getPriceFromList (ItemIsTradeable $itemInstance) {
+ public final function getPriceFromList (ItemIsTradeable $itemInstance) {
$price = 0;
// Iterate throw whole list
throw new MissingMethodException(array($partnerInstance, 'isContractPartner'), self::EXCEPTION_MISSING_METHOD);
}
- // Instanz holen
+ // Get new instance
$contractInstance = new WorksContract();
// Debug-Meldung ausgeben
}
// Getter for ship name
- public function getShipName () {
+ public final function getShipName () {
if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Schiffsname <strong>%s</strong> angefordert.<br />\n",
__CLASS__,
__LINE__,
}
// Getter for ship instance
- public function getShipInstance () {
+ public final function getShipInstance () {
if ((defined('DEBUG_CONTRACT')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Schiff-Instanz angefordert.<br />\n",
__CLASS__,
__LINE__
}
// Setter for contract partner
- public function setContractPartner (ContractPartner $partnerInstance) {
+ public final function setContractPartner (ContractPartner $partnerInstance) {
$this->contractPartner = $partnerInstance;
}
// Getter for contract partner
- public function getContractPartner () {
+ public final function getContractPartner () {
return $this->contractPartner;
}
// Setter for contract party
- public function setContractParty (ContractPartner $partyInstance) {
+ public final function setContractParty (ContractPartner $partyInstance) {
$this->contractParty = $partyInstance;
}
// Getter for contract party
- public function getContractParty () {
+ public final function getContractParty () {
return $this->contractParty;
}
// Setter for signature
- public function setSigned ($signed) {
+ public final function setSigned ($signed) {
$this->signed = (boolean) $signed;
}
}
// Setter for merchant instance
- public function setMerchantInstance (Merchant $merchantInstance) {
+ public final function setMerchantInstance (Merchant $merchantInstance) {
$this->merchantInstance = $merchantInstance;
}
// Getter for merchant instance
- public function getMerchantInstance () {
+ public final function getMerchantInstance () {
return $this->merchantInstance;
}
// Getter for total price
- public function getTotalPrice () {
+ public final function getTotalPrice () {
// Get ship instance
$shipInstance = $this->getShipInstance();
// Die Reederei-Klasse
class ShippingCompany extends BaseSimulator implements Customer, ContractPartner {
- // Firmenname
+ /**
+ * Full name of this company
+ */
private $companyName = "Namenlose Reederei";
- // Firmenkuerzel
+ /**
+ * Shorted name of this company
+ */
private $shortName = "";
- // Reederei-Gruender
+ /**
+ * Instance of the founder
+ */
private $founderInstance = null;
- // Angestellten-Liste
+ /**
+ * Employed people by this company
+ */
private $employeeList = null;
- // Zugewiesener Hafen
+ /**
+ * Headquarter harbor instance
+ */
private $hqInstance = null;
- // Werftenliste
+ /**
+ * List of all assigned shipyards
+ */
private $shipyardList = null;
- // Der Reederei gehoerenden Schiffe
+ /**
+ * List of owned ships
+ */
private $ownedShips = null;
- // Bauauftraege als Kunde
+ /**
+ * Work constracts this company is currently working on
+ */
private $contractList = null;
- // Konstruktor
+ /**
+ * Main constructor
+ *
+ * @return void
+ */
private function __construct () {
// Call parent constructor
parent::constructor(__CLASS__);
// Reederei gruenden (create wegen Namenskonvention)
public static function createShippingCompany ($companyName, Harbor $hqInstance) {
- // Instanz holen
+ // Get new instance
$companyInstance = new ShippingCompany();
if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $companyInstance->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> wird gegründet.<br />\n",
// Auftragsliste erstellen
$companyInstance->createContractList();
- // Etwas aufraeumen
+ // Clean up a little
$companyInstance->removeWidth();
$companyInstance->removeHeight();
$companyInstance->removeLength();
}
// Setter-Methode fuer Firmennamen
- public function setCompanyName ($companyName) {
+ public final function setCompanyName ($companyName) {
$this->companyName = (string) $companyName;
}
// Getter-Methode fuer Firmennamen
- public function getCompanyName () {
+ public final function getCompanyName () {
return $this->companyName;
}
// Setter-Methode fuer Firmensitz
- public function setHQInstance (Harbor $hqInstance) {
+ public final function setHQInstance (Harbor $hqInstance) {
$this->hqInstance = $hqInstance;
}
}
// Setter fuer Reederei-Gruender
- public function setCompanyFounder(CompanyEmployee $founderInstance) {
+ public final function setCompanyFounder(CompanyEmployee $founderInstance) {
if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> ist von <strong>%s %s</strong> gegründet worden.<br />\n",
__CLASS__,
__LINE__,
}
// Getter for founder instance
- public function getFounderInstance () {
+ public final function getFounderInstance () {
return $this->founderInstance;
}
} elseif (!is_object($shipyard)) {
// Not an object! ;-(
throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT);
- } elseif (!$shipyard->isClass("Shipyard")) {
+ } elseif (!$shipyard->isSameClass("Shipyard")) {
// Nope, so throw exception
throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING);
}
}
// Getter for total employees
- public function getTotalEmployee () {
+ public final function getTotalEmployee () {
// Count all...
$total = $this->employeeList->count();
}
// Getter for total shipyards
- public function getTotalShipyards () {
+ public final function getTotalShipyards () {
if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Für die Reederei <strong>%s</strong> werden die Anzahl der Werften in allen Häfen ermittelt.<br />\n",
__CLASS__,
__LINE__,
} elseif (!is_object($shipyard)) {
// Not an object! ;-(
throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT);
- } elseif (!$shipyard->isClass("Shipyard")) {
+ } elseif (!$shipyard->isSameClass("Shipyard")) {
// Class is not a shipyard
throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING);
}
} elseif (!is_object($shipyard)) {
// Not an object! ;-(
throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT);
- } elseif (!$shipyard->isClass("Shipyard")) {
+ } elseif (!$shipyard->isSameClass("Shipyard")) {
// Class is not a shipyard
throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING);
}
}
// Get latest added contract instance
- public function getLastContractInstance () {
+ public final function getLastContractInstance () {
// Get iterator
$iter = $this->contractList->getIterator();
}
// Setter for merchant instance
- public function setMerchantInstance (Merchant $merchantInstance) {
+ public final function setMerchantInstance (Merchant $merchantInstance) {
// Get contract
$contractInstance = $this->getLastContractInstance();
} elseif (!is_object($contractInstance)) {
// Not an object! ;-(
throw new NoObjectException($contractInstance, self::EXCEPTION_IS_NO_OBJECT);
- } elseif (!$contractInstance->isClass('WorksContract')) {
+ } elseif (!$contractInstance->isSameClass('WorksContract')) {
// Is not a merchant
throw new ClassMismatchException(array($contractInstance->__toString(), "WorksContract"), self::EXCEPTION_CLASSES_NOT_MATCHING);
}
// Set description
$this->setPartDescr("Namenlose Landkonstruktion");
- // Etwas aufraeumen (brauchen wir hier nicht)
+ // Clean up a little
$this->removeNumberFormaters();
}
- // Konstruktor aufrufen
+ /**
+ * Calls the private constructor
+ *
+ * @param $class The class' name
+ * @return void
+ */
public function constructor ($class) {
$this->__construct($class);
}
}
// Setter fuer Hafennamen
- public function setHarborName ($harborName) {
+ 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 function getHarborName () {
+ 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;
}
$shipyardInstance->setHeight(30);
$shipyardInstance->setLength(100);
- // Etwas aufraeumen
+ // Clean up a little
$shipyardInstance->removeDraught();
$shipyardInstance->removeSystemArray();
}
// Setter-Methode fuer Werft-Name
- public function setShipyardName ($shipyardName) {
+ public final function setShipyardName ($shipyardName) {
$this->shipyardName = (string) $shipyardName;
}
// Getter-Methode fuer Werft-Name
- public function getShipyardName () {
+ public final function getShipyardName () {
return $this->shipyardName;
}
// Setter-Methode fuer Hafen-Instanz
- public function setHarborInstance (Harbor $harborInstance) {
+ public final function setHarborInstance (Harbor $harborInstance) {
$this->harborInstance = $harborInstance;
}
// Getter-Methode fuer Hafen-Instanz
- public function getHarborInstance () {
+ public final function getHarborInstance () {
return $this->harborInstance;
}
// Setter fuer Reederei-Instanz
- public function setCompanyInstance (ShippingCompany $companyInstance) {
+ public final function setCompanyInstance (ShippingCompany $companyInstance) {
$this->shippingCompany = $companyInstance;
}
// Getter fuer Reederei-Instanz
- public function getCompanyInstance () {
+ public final function getCompanyInstance () {
return $this->shippingCompany;
}
// Set description
$this->setPartDescr("Namenloser Antrieb");
- // Etwas aufraeumen
+ // Clean up a little
$this->removeNumberFormaters();
$this->removePartInstance();
}
- // Konstruktor aufrufen
+ /**
+ * Calls the private constructor
+ *
+ * @param $class The class' name
+ * @return void
+ */
public function constructor ($class) {
$this->__construct($class);
}
// Setter-Methode fuert PS-Zahl
- public function setHorsePower ($hp) {
+ public final function setHorsePower ($hp) {
if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Antriebsleistung wird auf <strong>%d</strong> PS gesetzt.<br />\n",
__CLASS__,
__LINE__,
}
// Setter-Methode fuer Nockenanzahl
- public function setNumCams ($cams) {
+ public final function setNumCams ($cams) {
if ((defined('DEBUG_DRIVE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Nockenanzahl wird auf <strong>%d</strong> Nocken gesetzt.<br />\n",
__CLASS__,
__LINE__,
}
// Setter for price
- public function setPrice ($price) {
+ public final function setPrice ($price) {
$this->price = (float) $price;
}
// Getter for price
- public function getPrice () {
+ public final function getPrice () {
return $this->price;
}
// Einen Motor erstellen
public static function createMotor ($descr, $hp, $cams, $w, $h, $l) {
- // Instanz holen
+ // Get new instance
$motorInstance = new Motor();
// Debug message
// Beschreibung
$this->setPartDescr("Schiffsteil");
- // Etwas aufraeumen
+ // Clean up a little
$this->removeNumberFormaters();
}
- // Konstruktor aufrufen
+ /**
+ * Calls the private constructor
+ *
+ * @param $class The class' name
+ * @return void
+ */
public function constructor ($class) {
$this->__construct($class);
}
// Setter for price
- public function setPrice ($price) {
+ public final function setPrice ($price) {
$this->price = (float) $price;
}
// Getter for price
- public function getPrice () {
+ public final function getPrice () {
return $this->price;
}
// Maschinenraum erstellen
public static function createMaschineRoom () {
- // Instanz holen
+ // Get new instance
$roomInstance = new MaschineRoom();
// Debug message
*
* @param $amountPersonell Number of personell we shall
* generate
- * @return $personellInstance An instance of this object with a
+ * @return $personellInstance An instance of this object with a
* list of personells
*/
public static function createSimulatorPersonell ($amountPersonell) {
// Get a new instance
$personellInstance = new SimulatorPersonell();
- // Generate unique ID number
- $personellInstance->createUniqueID();
-
// Debug message
if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $personellInstance->getDebugInstance()->output(sprintf("[%s:%d] Es werden <strong>%d</strong> Personal bereitgestellt.<br />\n",
__CLASS__,
// Create requested amount of personell
for ($idx = 0; $idx < $amountPersonell; $idx++) {
- $personellInstance->addPersonell();
+ $personellInstance->addRandomPersonell();
}
// Debug message
* list from an existing database backend
*
* @param $idNumber The ID number (only right part) of the list
- * @return $personellInstance An instance of
+ * @return $personellInstance An instance of
* @throws InvalidIDFormatException If the given id number
* $idNumber is invalid
* @throws NullPointerException If a null pointer (instance)
}
// Add new personell object to our list
- public function addPersonell () {
+ public function addRandomPersonell () {
// Gender list...
$genders = array('M', 'F');
*
* @return $count Amount of unemployed personell
*/
- public function getAllUnemployed () {
+ public final function getAllUnemployed () {
if ((defined('DEBUG_PERSONELL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Es werden alle erwerbslosen Personen gesucht.<br />\n",
__CLASS__,
__LINE__
* @return void
*/
public function saveObjectToDatabase () {
- // Get the database
+ // Get the database
$dbInstance = $this->getDatabaseInstance();
// Prepare the limitation object. We just need the personellList array object.
*
* @return $personellList The list of all personells
*/
- public function getPersonellList () {
+ public final function getPersonellList () {
return $this->personellList;
}
// Array-Objekt generieren
$this->createStructuresArray();
-
+
// Instanz entfernen
$this->removePartInstance();
$this->removeNumberFormaters();
}
- // Konstruktor aufrufen
+ /**
+ * Calls the private constructor
+ *
+ * @param $class The class' name
+ * @return void
+ */
public function constructor ($class) {
$this->__construct($class);
}
}
// Getter-Methode fuer Strukturen-Array
- public function getStructuresArray () {
+ public final function getStructuresArray () {
return $this->structures;
}
}
// Setter-Methode fuer Schiffsnamen
- public function setShipName ($shipName) {
+ public final function setShipName ($shipName) {
// Cast the string
$shipName = (string) $shipName;
}
// Getter-Methode fuer Schiffsnamen
- public function getShipName () {
+ 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__,
}
// Setter-Methode fuer Tiefgang
- public function setDraught ($draught) {
+ 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__,
}
// Getter-Methode fuer Tiefgang
- public function getDraught() {
+ 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__,
}
// Setter-Methode fuer Anzahl Anker
- public function setNumAnchor ($numAnchor) {
+ 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__,
<?php
-class PassengerShip extends BaseShip implements ConstructableShip {
+class PassengerShip extends BaseShip implements ConstructableShip, LimitableObject {
// Konstruktor
private function __construct () {
// Eltern-Kontruktor aufrufen
// Passagier-Schiff erstellen
public static function createPassengerShip ($shipName) {
- // Instanz holen
+ // Get new instance
$passInstance = new PassengerShip();
// Debug message
// Debug-Meldung ausgeben?
if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) {
- // Instanz holen
+ // Get new instance
$cabType = "Kabine ohne Namen";
$cab = $el->getPartInstance();
if (!is_null($cab)) {
$this->getShipName(),
$numBeds
));
-
+
// Anzahl zurueckliefern
return $numBeds;
}
// Set description
$this->setPartDescr("Schiffsstrukturen");
- // Etwas aufraeumen
+ // Clean up a little
$this->removeNumberFormaters();
}
- // Konstruktor aufrufen
+ /**
+ * Calls the private constructor
+ *
+ * @param $class The class' name
+ * @return void
+ */
public function constructor ($class) {
$this->__construct($class);
}
// Setter for price
- public function setPrice ($price) {
+ public final function setPrice ($price) {
$this->price = (float) $price;
}
// Getter for price
- public function getPrice () {
+ public final function getPrice () {
return $this->price;
}
// Remove price
- public function removePrice () {
+ public function removePrice () {
unset($this->price);
}
}
// Call parent constructor
parent::constructor($class);
- //�Debug message
+ // Debug message
if (((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) {
$this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
__CLASS__,
// Set description
$this->setPartDescr("Kabine");
-
- // Maybe clean up a little
- if ($class == __CLASS__) {
- $this->removeSystemArray();
- }
}
- // Konstruktor aufrufen
+ /**
+ * Calls the private constructor
+ *
+ * @param $class The class' name
+ * @return void
+ */
public function constructor ($class) {
$this->__construct($class);
}
- // Allgemeine Kabine erstellen
- public static function createBaseCabin () {
- // Instanz holen
- $cabinInstance = new BaseCabin(__CLASS__);
-
- // Debug message
- if ((defined('DEBUG_CABIN')) || (defined('DEBUG_ALL'))) $cabinInstance->getDebugInstance()->output(sprintf("[%s:%d] Eine allgemeine Kabine wird erstellt.<br />\n",
- __CLASS__,
- __LINE__
- ));
-
- // Generate unique ID number
- $cabinInstance->createUniqueID();
-
- // Instanz zurueckgeben
- return $cabinInstance;
- }
-
// Is this a cabin?
- public function isCabin () {
- return ($this->isClass("BaseCabin"));
+ public final function isCabin () {
+ return ($this->isSameClass("BaseCabin"));
}
/**
// Economy-Kabine erstellen
public static function createEconomyCabin ($numLuxury, $numRooms, $numBeds, $dim) {
- // Instanz holen
+ // Get new instance
$ecoInstance = new EconomyCabin();
// Debug message
// 2-Sterne-Klasse erstellen
public static function createLowCabin ($numLuxury, $numRooms, $numBeds, $dim) {
- // Instanz holen
+ // Get new instance
$lowInstance = new LowCabin();
// Debug message
// Eine Luxuskabine erstellen
public static function createLuxuryCabin ($numLuxury, $numRooms, $numBeds, $dim) {
- // Instanz holen
+ // Get new instance
$luxuryInstance = new LuxuryCabin();
// Debug message
// Premier-Kabine erstellen
public static function createPremierCabin ($numLuxury, $numRooms, $numBeds, $dim) {
- // Instanz holen
+ // Get new instance
$premierInstance = new PremierCabin();
// Debug message
$this->setPartDescr("Kabinenstruktur");
}
- // Konstruktor aufrufen
+ /**
+ * Calls the private constructor
+ *
+ * @param $class The class' name
+ * @return void
+ */
public function constructor ($class) {
$this->__construct($class);
}
}
// Wrapper fuer setDeckInstance->setPartInstance
- public function setDeckInstance ($deck) {
+ public final function setDeckInstance ($deck) {
if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Wrapper setDeckInstance->setPartInstance erreicht.<br />\n",
__CLASS__,
__LINE__
}
// Getter-Methode fuer Anzahl Betten
- public function getNumBeds () {
+ public final function getNumBeds () {
if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%d</strong> Betten angefordert.<br />\n",
__CLASS__,
__LINE__,
}
// Getter-Methode fuer Anzahl Kabinen
- public function getNumCabin () {
+ public final function getNumCabin () {
if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%d</strong> Kabine(n) angefordert.<br />\n",
__CLASS__,
__LINE__,
}
// Setter-Methode fuer Anzahl Betten
- public function setNumBeds ($numBeds) {
+ public final function setNumBeds ($numBeds) {
if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%d</strong> Betten gesetzt.<br />\n",
__CLASS__,
__LINE__,
}
// Setter-Methode fuer Anzahl Raeume
- public function setNumRooms ($numRooms) {
+ public final function setNumRooms ($numRooms) {
if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%d</strong> Raum/Räume gesetzt.<br />\n",
__CLASS__,
__LINE__,
}
// Setter-Methode fuer Anzahl Kabinen
- public function setNumCabin ($numCabin) {
+ public final function setNumCabin ($numCabin) {
if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] <strong>%d</strong> Kabine(n) gesetzt.<br />\n",
__CLASS__,
__LINE__,
$num = $this->getNumCabin();
$cabinBeds = $beds * $num;
if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) {
- // Instanz holen
+ // Get new instance
$cabType = "Kabine ohne Namen";
$cab = $this->getPartInstance();
if (!is_null($cab)) {
$this->setPartDescr("Deckstruktur");
}
- // Konstruktor aufrufen
+ /**
+ * Calls the private constructor
+ *
+ * @param $class The class' name
+ * @return void
+ */
public function constructor ($class) {
$this->__construct($class);
}
}
// Setter-Methode fuer Anzahl Decks
- public function setNumDecks($numDecks) {
+ public final function setNumDecks($numDecks) {
$this->numDecks = (int) $numDecks;
}
// Getter-Methode fuer Anzahl Decks
- public function getNumDecks() {
+ public final function getNumDecks() {
return $this->numDecks;
}
}
// Set description
$this->setPartDescr("Aufbauten");
-
- // Shall we clean up?
- if ($class == __CLASS__) {
- $this->removeSystemArray();
- }
}
/**
$this->__construct($class);
}
- /**
- * Creates an upper(=super) structure
- */
- public static function createBaseUpperStructure () {
- // Instanz holen
- $upperInstance = new BaseUpperStructure (__CLASS__);
-
- // Debug message
- if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) {
- $upperInstance->getDebugInstance()->output(sprintf("[%s:%d] Aufbauten wird konstruiert.<br />\n",
- __CLASS__,
- __LINE__
- ));
- }
-
- // Unique-ID setzen
- $upperInstance->createUniqueID();
-
- // Return instance
- return $upperInstance;
- }
-
/**
* Stub!
*/
// Autodeck erstellen
public static function createCarDeck ($numDecks, $dim) {
- // Instanz holen
+ // Get new instance
$carInstance = new CarDeck();
// Debug message
}
// Setter-Methode fuer Anzahl Decks
- public function setNumDecks($numDecks) {
+ public final function setNumDecks($numDecks) {
parent::setNumDecks($numDecks);
}
// Getter-Methode fuer Anzahl Decks
- public function getNumDecks() {
+ public final function getNumDecks() {
return parent::getNumDecks();
}
// LKW-Deck erstellen
public static function createTrainDeck ($numDecks, $dim) {
- // Instanz holen
+ // Get new instance
$trainInstance = new TrainDeck();
// Debug message
}
// Setter-Methode fuer Anzahl Decks
- public function setNumDecks ($numDecks) {
+ public final function setNumDecks ($numDecks) {
parent::setNumDecks($numDecks);
}
// Getter-Methode fuer Anzahl Decks
- public function getNumDecks() {
+ public final function getNumDecks() {
return parent::getNumDecks();
}
// LKW-Deck erstellen
public static function createTruckDeck ($numDecks, $dim) {
- // Instanz holen
+ // Get new instance
$truckInstance = new TruckDeck();
// Debug message
}
// Setter-Methode fuer Anzahl Decks
- public function setNumDecks ($numDecks) {
+ public final function setNumDecks ($numDecks) {
parent::setNumDecks($numDecks);
}
// Getter-Methode fuer Anzahl Decks
- public function getNumDecks() {
+ public final function getNumDecks() {
return parent::getNumDecks();
}
<?php
-// Decks for cargo
+// General (base) deck
class BaseDeck extends BaseDeckStructure {
/**
- * Constructor for cargo decks in general
- */
+ * Constructor for cargo decks in general
+ */
private function __construct ($class) {
// Call parent constructor
parent::constructor($class);
));
// Set description
- $this->setPartDescr("Deck");
-
- // Maybe clean up?
- if ($class == __CLASS__) {
- $this->removeSystemArray();
- }
+ $this->setPartDescr("Allgemeines Deck");
}
- // Ruft nur den privaten Konstruktor auf
+ /**
+ * Calls the private constructor
+ *
+ * @param $class The class' name
+ * @return void
+ */
public function constructor ($class) {
$this->__construct($class);
}
- // Ein allgemeines Deck erstellen
- public static function createBaseDeck () {
- // Instanz holen
- $deckInstance = new BaseDeck(__CLASS__);
-
- // Debug message
- if ((defined('DEBUG_DECK')) || (defined('DEBUG_ALL'))) $deckInstance->getDebugInstance()->output(sprintf("[%s:%d] Ein allgemeines Deck wird konstruiert.<br />\n",
- __CLASS__,
- __LINE__
- ));
-
- // Unique-ID setzen
- $deckInstance->createUniqueID();
-
- // Instanz zurueckgeben
- return $deckInstance;
- }
-
/**
* Stub!
*/
// Eine Kommandobruecke erstellen
public static function createBridge ($width, $height, $length) {
- // Instanz holen
+ // Get new instance
$bridgeInstance = new Bridge();
// Debug message
* @return boolean The result of comparing both's unique ID
*/
public final function equals ($object) {
- if ((defined('DEBUG_SYSTEM')) && (is_object($this->getDebugInstance()))) $this->getDebugInstance()->output(sprintf("[%s:] Ist <strong>%s</strong>=<strong>%s</strong>?<br />\n",
- $this->__toString(),
- $this->__toString(),
- $object->__toString()
- ));
return ($this->getUniqueID() == $object->getUniqueID());
}
*/
public function itemMatches ($itemInstance) {
return (
- ($this->__toString() == $itemInstance->__toString())
- && ($this->getPartDescr() == $itemInstance->getPartDescr())
+ (
+ $this->__toString() == $itemInstance->__toString()
+ ) && (
+ $this->getPartDescr() == $itemInstance->getPartDescr()
+ )
);
}
* @throws InvalidArrayCountException If the array contains less or
* more than two elements
*/
- public function getPathFileNameFromObject () {
+ public final function getPathFileNameFromObject () {
// Get the main object's unique ID. We use this as a path/filename combination
$pathFile = $this->getUniqueID();
* @throws MissingMethodException If the required method
* toString() is missing
*/
- public function getObjectFromCachedData ($uniqueID) {
+ public final function getObjectFromCachedData ($uniqueID) {
// Get instance for file handler
$inputHandler = $this->getIOInstance();
));
}
-// Etwas aufraeumen
+// Clean up a little
unset($einbauten);
unset($part);
unset($eval);
$contract->formatCurrency($totalValue)
));
-// Etwas aufraeumen
+// Clean up a little
unset($totalValue);
// Den Bauvertrag unterschreiben (damit wird er in den Bau-Queue aufgenommen)