/**
* General cabin structure class
*
- * @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
protected function __construct ($className) {
// Call parent constructor
parent::__construct($className);
-
- // Set description
- $this->setObjectDescription("Kabinenstruktur");
}
// Kabine hinzufuegen
public function addShipPartToShip (ConstructableShip $shipInstance, ConstructableShipPart $cabinInstance) {
- if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Kabine <strong>%s</strong> wird für das Schiff <strong>%s</strong> konstruiert.<br />\n",
- __CLASS__,
- __LINE__,
- $cabinInstance->getObjectDescription(),
- $shipInstance->getShipName()
- ));
-
// Eltern-Methode aufrufen
parent::addShipPartToShip ($shipInstance, $cabinInstance);
// Instanz setzen
$this->setDeckInstance($cabinInstance);
-
- // Einbaut-Meldung ausgeben
- if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Kabine <strong>%s</strong> wurde in das Schiff eingebaut.<br />\n",
- __CLASS__,
- __LINE__,
- $cabinInstance->getObjectDescription(),
- $shipInstance->getShipName()
- ));
}
// Wrapper fuer setDeckInstance->setPartInstance
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__
- ));
parent::setPartInstance($deck);
}
// Getter-Methode fuer Anzahl Betten
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__,
- $this->numBeds
- ));
return $this->numBeds;
}
// Getter-Methode fuer Anzahl Kabinen
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__,
- $this->numCabin
- ));
return $this->numCabin;
}
// Setter-Methode fuer Anzahl Betten
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__,
- $numBeds
- ));
$this->numBeds = $numBeds;
}
// Setter-Methode fuer Anzahl Raeume
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__,
- $numRooms
- ));
$this->numRooms = $numRooms;
}
// Setter-Methode fuer Anzahl Kabinen
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__,
- $numCabin
- ));
$this->numCabin = $numCabin;
}
// Loesch-Methode fuer Anzahl Betten
public final function removeNumBeds() {
- if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Betten gelöscht.<br />\n",
- __CLASS__,
- __LINE__
- ));
unset($this->numBeds);
}
// Loesch-Methode fuer Anzahl Kabinen
public final function removeNumCabin() {
- if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Kabinen gelöscht.<br />\n",
- __CLASS__,
- __LINE__
- ));
unset($this->numCabin);
}
// Loesch-Methode fuer Anzahl Raeume
public final function removeNumRooms() {
- if ((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Anzahl Räume gelöscht.<br />\n",
- __CLASS__,
- __LINE__
- ));
unset($this->numRooms);
}
}
// Debug-Meldung ausgeben
- $this->getDebugInstance()->output(sprintf("[%s:%d] Es exisitieren <strong>%d</strong> Kabinen vom Typ <strong>%s</strong> zu je <strong>%d</strong> Betten. Das sind <strong>%d</strong> Betten.<br />\n",
+ $this->debugOutput(sprintf("[%s:%d] Es exisitieren <strong>%d</strong> Kabinen vom Typ <strong>%s</strong> zu je <strong>%d</strong> Betten. Das sind <strong>%d</strong> Betten.",
__CLASS__,
__LINE__,
$num,