// Konstruktor
private function __construct () {
- // Eltern-Konstruktor aufrufen
+ // Call parent constructor
parent::constructor(__CLASS__);
// Debug message
));
}
- // Beschreibung setzen
+ // Set description
$this->setPartDescr("Reederei");
- // Unique-ID erzeugen
+ // Generate unique ID number
$this->createUniqueID();
// Clean up a little
// Reederei gruenden (create wegen Namenskonvention)
public static function createShippingCompany ($companyName, Harbor $hqInstance) {
// Instanz holen
- $companyInstance = new ShippingCompany();
+ $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",
__CLASS__,
// Element holen
$employee = $iterator->current();
} else {
- // Should normally not happen... :(
+ // Should�normally not happen... :(
throw new StructuresOutOfBoundsException($idx, self::EXCEPTION_INDEX_OUT_OF_BOUNDS);
}
}
}
// Validate the requested ship type with the company if they can construct it
- public function validateWorksContractShipType (WorksContract $contractInstance) {
+ public function validateWorksContractShipType (SignableContract $contractInstance) {
if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> prüft den Bauauftrag der <strong>%s</strong>.<br />\n",
__CLASS__,
__LINE__,
// Validate if the first found shipyard can construct the requested type
$result = $shipyard->isShipTypeConstructable($shipType);
- // Does this shipyard construct the requested ship type?
+ //�Does this shipyard construct the requested ship type?
if ($result) break; // Then abort the search!
}
}
// As a customer the shipping company can add new contracts
- public function addNewWorksContract (WorksContract $contractInstance) {
+ public function addNewWorksContract (SignableContract $contractInstance) {
if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erstellt einen Bauauftrag für ein <strong>%s</strong> mit dem Namen <strong>%s</strong>.<br />\n",
__CLASS__,
__LINE__,
}
// As a customer the shippng company can withdraw from a contract
- public function withdrawFromContract (WorksContract $contractInstance) {
+ public function withdrawFromContract (SignableContract $contractInstance) {
ApplicationEntryPoint::app_die("WITHDRAW:<pre>".print_r($contractInstance, true)."</pre>");
}
}
// Sign a contract with an other party which must also implement Customer
- public function signContract (WorksContract $contractInstance, ContractPartner $partnerInstance) {
+ public function signContract (SignableContract $contractInstance, ContractPartner $partnerInstance) {
+ // Check wether the other party is our contract partner
if (!$partnerInstance->isContractPartner($contractInstance)) {
// Invalid contract partner!
throw new InvalidContractPartnerException($partnerInstance, self::EXCEPTION_CONTRACT_PARTNER_INVALID);
}
-
+
// Determine if company "signs" own contract (must be done) or with an other party
if ($this->equals($partnerInstance)) {
// With itself
}
// Is this the right contract partner?
- public function isContractPartner (WorksContract $contractInstance) {
+ public function isContractPartner (SignableContract $contractInstance) {
// Get contract partner instance and compare it with $this contract partner
return ($this->equals($contractInstance->getContractPartner()));
}