application/ship-simu/interfaces/class_ConstructableShipPart.php -text
application/ship-simu/interfaces/class_ContractPartner.php -text
application/ship-simu/interfaces/class_Customer.php -text
-application/ship-simu/interfaces/class_ItemIsTradeable.php -text
application/ship-simu/interfaces/class_Personellizer.php -text
application/ship-simu/interfaces/class_SignableContract.php -text
application/ship-simu/loader.php -text
* You can prevent adding this application to the selector by uncommenting the
* following line:
*
- * if ((isset($this)) && (is_object($this)) && ($this->isSameClass("ApplicationSelector"))) { return; }
+ * if ((isset($this)) && (is_object($this)) && ($this->isClass("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)
+++ /dev/null
-<?php
-/**
- * An interface for tradeable items
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software
- * @license GNU GPL 3.0 or any newer version
- * @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
- * 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 <http://www.gnu.org/licenses/>.
- */
-interface ItemIsTradeable extends FrameworkInterface {
- /**
- * Is this item (=object) tradeable?
- *
- * @return boolean true = is a tradeable object,
- * false = is not tradeable
- */
- function isTradeable ();
-}
-
-// [EOF]
-?>
}
// Add new item to merchant's price list
- public function addItemToPriceList (ItemIsTradeable $itemInstance, $price) {
+ public function addItemToPriceList (TradeableItem $itemInstance, $price) {
// Secure pricing
$price = (float) $price;
}
// Get a price from the merchant's list
- public final function getPriceFromList (ItemIsTradeable $itemInstance) {
+ public final function getPriceFromList (TradeableItem $itemInstance) {
$price = 0;
// Iterate throw whole list
} elseif (!is_object($shipyard)) {
// Not an object! ;-(
throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT);
- } elseif (!$shipyard->isSameClass("Shipyard")) {
+ } elseif (!$shipyard->isClass("Shipyard")) {
// Nope, so throw exception
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->isSameClass("Shipyard")) {
+ } elseif (!$shipyard->isClass("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->isSameClass("Shipyard")) {
+ } elseif (!$shipyard->isClass("Shipyard")) {
// Class is not a shipyard
throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING);
}
} elseif (!is_object($contractInstance)) {
// Not an object! ;-(
throw new NoObjectException($contractInstance, self::EXCEPTION_IS_NO_OBJECT);
- } elseif (!$contractInstance->isSameClass('WorksContract')) {
+ } elseif (!$contractInstance->isClass('WorksContract')) {
// Is not a merchant
throw new ClassMismatchException(array($contractInstance->__toString(), "WorksContract"), self::EXCEPTION_CLASSES_NOT_MATCHING);
}
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class Motor extends BaseDrive implements ItemIsTradeable, ConstructableShipPart {
+class Motor extends BaseDrive implements TradeableItem, ConstructableShipPart {
// Constructor
private function __construct() {
// Call parent constructor
// Is this a cabin?
public final function isCabin () {
- return ($this->isSameClass("BaseCabin"));
+ return ($this->isClass("BaseCabin"));
}
/**
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class EconomyCabin extends BaseCabin implements ItemIsTradeable, ConstructableShipPart {
+class EconomyCabin extends BaseCabin implements TradeableItem, ConstructableShipPart {
// Konstruktor
private function __construct () {
// Call parent constructor
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class LowCabin extends BaseCabin implements ItemIsTradeable, ConstructableShipPart {
+class LowCabin extends BaseCabin implements TradeableItem, ConstructableShipPart {
// Konstruktor
private function __construct () {
// Call parent constructor
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class LuxuryCabin extends BaseCabin implements ItemIsTradeable, ConstructableShipPart {
+class LuxuryCabin extends BaseCabin implements TradeableItem, ConstructableShipPart {
// Konstruktor
private function __construct () {
// Call parent constructor
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class PremierCabin extends BaseCabin implements ItemIsTradeable, ConstructableShipPart {
+class PremierCabin extends BaseCabin implements TradeableItem, ConstructableShipPart {
// Konstruktor
private function __construct () {
// Call parent constructor
function constructor ($class) {
$this->__construct($class);
}
-
- /**
- * Stub!
- */
- public function saveObjectToDatabase () {
- $this->getDebugInstance()->output(sprintf("[%s:] Stub <strong>%s</strong> erreicht.",
- $this->__toString(),
- __FUNCTION__
- ));
- }
-
- /**
- * Limits this object with an ObjectLimits instance
- */
- public function limitObject (ObjectLimits $limitInstance) {
- ApplicationEntryPoint::app_die("".__METHOD__." reached! Stub!");
- }
}
// [EOF]
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class CarDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPart {
+class CarDeck extends BaseDeck implements TradeableItem, ConstructableShipPart {
// Konstruktor
private function __construct () {
// Call parent constructor
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class TrainDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPart {
+class TrainDeck extends BaseDeck implements TradeableItem, ConstructableShipPart {
// Konstruktor
private function __construct () {
// Call parent constructor
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class TruckDeck extends BaseDeck implements ItemIsTradeable, ConstructableShipPart {
+class TruckDeck extends BaseDeck implements TradeableItem, ConstructableShipPart {
// Konstruktor
private function __construct () {
// Call parent constructor
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class Bridge extends BaseUpperStructure implements ItemIsTradeable, ConstructableShipPart {
+class Bridge extends BaseUpperStructure implements TradeableItem, ConstructableShipPart {
// Constructor
private function __construct () {
// Call parent constructor
return $this->lastContents;
}
+ /**
+ * Getter for file extension
+ *
+ * @return $fileExtension The array with elements 'header' and 'data'.
+ */
+ public final function getFileExtension () {
+ return $this->fileExtension;
+ }
+
/**
* Get cached (last fetched) data from the local file database
*
// Change directory
@chdir("../..");
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
// Load config file
-require(dirname(dirname(__FILE__)) . "/inc/config.php");
+require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php");
// Load all include files
require(PATH . "inc/includes.php");
// Load all game classes
require(PATH . "inc/classes.php");
+// Load file I/O handler
+require(PATH . "inc/file_io.php");
+
+// Load database layer
+require(PATH . "inc/database.php");
+
// Set default application
FrameworkConfiguration::getInstance()->setConfigEntry("default_application", "ship-simu");
+$application = "ship-simu";
-// Set testing mode (no starter.php will be loaded!)
-define('TEST_MODE', true);
+// Load more includes
+require(PATH . "application/ship-simu/loader.php");
// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
// jetzt die Personalliste wiederherstellen
// Change directory
@chdir("../..");
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
// Load config file
-require(dirname(dirname(__FILE__)) . "/inc/config.php");
+require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php");
// Load all include files
require(PATH . "inc/includes.php");
// Load all game classes
require(PATH . "inc/classes.php");
+// Load file I/O handler
+require(PATH . "inc/file_io.php");
+
+// Load database layer
+require(PATH . "inc/database.php");
+
// Set default application
FrameworkConfiguration::getInstance()->setConfigEntry("default_application", "ship-simu");
+$application = "ship-simu";
-// Set testing mode (no starter.php will be loaded!)
-define('TEST_MODE', true);
+// Load more includes
+require(PATH . "application/ship-simu/loader.php");
// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
// jetzt die Personalliste wiederherstellen
// Change directory
@chdir("../..");
+// Set testing mode (no starter.php will be loaded!)
+define('TEST_MODE', true);
+
// Load config file
-require(dirname(dirname(__FILE__)) . "/inc/config.php");
+require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php");
// Load all include files
require(PATH . "inc/includes.php");
// Load all game classes
require(PATH . "inc/classes.php");
+// Load file I/O handler
+require(PATH . "inc/file_io.php");
+
+// Load database layer
+require(PATH . "inc/database.php");
+
// Set default application
FrameworkConfiguration::getInstance()->setConfigEntry("default_application", "ship-simu");
+$application = "ship-simu";
-// Set testing mode (no starter.php will be loaded!)
-define('TEST_MODE', true);
+// Load more includes
+require(PATH . "application/ship-simu/loader.php");
// Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen
// jetzt die Personalliste wiederherstellen