]> git.mxchange.org Git - shipsimu.git/blob - application/ship-simu/main/parts/class_BaseShipPart.php
8a95e54f4bc059b65636a713925f664c686da170
[shipsimu.git] / application / ship-simu / main / parts / class_BaseShipPart.php
1 <?php
2
3 // Dieses kann z.B. der Maschinenraum, die Bruecke, Kabinen, Laderaum, etc. sein
4 class BaseShipPart extends BaseSimulator {
5         // Price of this ship part
6         private $price = 0.00;
7
8         // Konstruktor
9         private function __construct($class) {
10                 // Call parent constructor
11                 parent::constructor($class);
12
13                 // Debug message
14                 if (((defined('DEBUG_SHIPPART')) || (defined('DEBUG_ALL'))) && (defined('DEBUG_CONSTRUCT'))) {
15                         $this->getDebugInstance()->output(sprintf("[%s:%d:] Kontruktor erreicht.<br />\n",
16                                 __CLASS__,
17                                 __LINE__
18                         ));
19                 }
20
21                 // Beschreibung
22                 $this->setPartDescr("Schiffsteil");
23
24                 // Clean up a little
25                 $this->removeNumberFormaters();
26         }
27
28         /**
29          * Calls the private constructor
30          *
31          * @param       $class  The class' name
32          * @return      void
33          */
34         public function constructor ($class) {
35                 $this->__construct($class);
36         }
37
38         // Setter for price
39         public final function setPrice ($price) {
40                 $this->price = (float) $price;
41         }
42
43         // Getter for price
44         public final function getPrice () {
45                 return $this->price;
46         }
47
48         // Remove price
49         public function removePrice () {
50                 unset($this->price);
51         }
52 }
53
54 // [EOF]
55 ?>