]> git.mxchange.org Git - shipsimu.git/blob - application/ship-simu/main/structures/class_BaseStructure.php
getter, setter are all final; several code clean-ups
[shipsimu.git] / application / ship-simu / main / structures / class_BaseStructure.php
1 <?php
2 // Konstruktionen allgemein (also Aufbauten/Unterbauten)
3 class BaseStructure extends BaseSimulator {
4         // Price of this structure
5         private $price = 0.00;
6
7         // Konstruktor (hier keine Exceptions aendern!)
8         private function __construct ($class) {
9                 // Call parent constructor
10                 parent::constructor($class);
11
12                 // Debug message
13                 if (((defined('DEBUG_STRUCTURE')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) {
14                         $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruktor erreicht.<br />\n",
15                                 __CLASS__,
16                                 __LINE__
17                         ));
18                 }
19
20                 // Set description
21                 $this->setPartDescr("Schiffsstrukturen");
22
23                 // Clean up a little
24                 $this->removeNumberFormaters();
25         }
26
27         /**
28          * Calls the private constructor
29          *
30          * @param       $class  The class' name
31          * @return      void
32          */
33         public function constructor ($class) {
34                 $this->__construct($class);
35         }
36
37         // Setter for price
38         public final function setPrice ($price) {
39                 $this->price = (float) $price;
40         }
41
42         // Getter for price
43         public final function getPrice () {
44                 return $this->price;
45         }
46
47         // Remove price
48         public function removePrice () {
49                 unset($this->price);
50         }
51 }
52
53 // [EOF]
54 ?>