generateUniqueId() and more useless/deprecated methods removed, code speed-up, link...
[shipsimu.git] / application / ship-simu / main / companies / class_ShippingCompany.php
index 971c578cf44974d5a7622d3d26f458f04ecdb46c..7a00527ffa33504c8600a871aca9d3e59df05ea1 100644 (file)
@@ -73,15 +73,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
        protected function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
-
-               // Set description
-               $this->setObjectDescription("A shipping company class");
-
-               // Generate unique ID number
-               $this->generateUniqueId();
-
-               // Clean up a little
-               $this->removeSystemArray();
        }
 
        /**
@@ -97,7 +88,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
 
                // Does the given user owns a company?
                if ($companyInstance->ifUserParticipatesInCompany($userInstance)) {
-                       // Then do some nastly caching here but don't throw an exception
+                       // Then do some nasty caching here but don't throw an exception
                        // because then you will hurt our web helpers... :/
                        $companyInstance->partialStub("Don't throw exceptions here.");
                } // END - if
@@ -345,7 +336,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
 
                        // Make this person employed and give him some money to work
                        $employee->setEmployed(true);
-                       $employee->setObjectDescription($dummy->getObjectDescription());
                        $employee->setRealClass($dummy->__toString());
                        $employee->increaseSalary((mt_rand(7, 14) * 100)); // Are 700 to 1400 EUR for the begin okay?
 
@@ -487,14 +477,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
                        $shipType
                ));
 
-               // Debug message
-               if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> baut in allen Werften bald Schiffe vom Typ <strong>%s</strong>.",
-                       __CLASS__,
-                       __LINE__,
-                       $this->getCompanyName(),
-                       $shipInstance->getObjectDescription()
-               ));
-
                // Iterate shipyard list
                for ($idx = $this->shipyardList->getIterator(); $idx->valid(); $idx->next()) {
                        // Get current element
@@ -519,13 +501,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
 
        // Validate the requested ship type with the company if they can construct it
        public function validateWorksContractShipType (SignableContract $contractInstance) {
-               if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> pr&uuml;ft den Bauauftrag der <strong>%s</strong>.",
-                       __CLASS__,
-                       __LINE__,
-                       $this->getCompanyName(),
-                       $contractInstance->getShipName()
-               ));
-
                // First get the ship type
                $shipInstance = $contractInstance->getShipInstance();
 
@@ -541,15 +516,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
                // Get it's real class name
                $shipType = $shipInstance->__toString();
 
-               // Debug message
-               if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> pr&uuml;ft, ob die <strong>%s</strong> (Typ:<strong>%s</strong>) gebaut werden kann.",
-                       __CLASS__,
-                       __LINE__,
-                       $this->getCompanyName(),
-                       $contractInstance->getShipName(),
-                       $shipInstance->getObjectDescription()
-               ));
-
                // Now check if the ship type is in any list and return the result
                return ($this->isShipTypeConstructable($shipType));
        }
@@ -608,13 +574,6 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
 
        // As a customer the shipping company can add new contracts
        public function addNewWorksContract (SignableContract $contractInstance) {
-               if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> erstellt einen Bauauftrag f&uuml;r ein <strong>%s</strong> mit dem Namen <strong>%s</strong>.",
-                       __CLASS__,
-                       __LINE__,
-                       $this->getCompanyName(),
-                       $contractInstance->getShipInstance()->getObjectDescription(),
-                       $contractInstance->getShipInstance()->getShipName()
-               ));
                $this->contractList->append($contractInstance);
        }