-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathunit.php
88 lines (71 loc) · 2.51 KB
/
unit.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
declare(strict_types = 1);
defined('INSIDE') OR exit('No direct script access allowed');
abstract class U_Unit {
/** @var int The unitID */
private $unitID;
/** @var float the metal cost */
private $costMetal;
/** @var float the crystal cost */
private $costCrystal;
/** @var float the deuterium cost */
private $costDeuterium;
/** @var float the energy cost */
private $costEnergy;
/** @var float the cost factor */
private $costFactor;
/**
* Unit constructor.
* @param int $uUnitID the internal unit-id
* @param float $uCostMetal the metal-cost for one unit/first level
* @param float $uCostCrystal the crystal-cost for one unit/first level
* @param float $uCostDeuterium the deuterium-cost for one unit/first level
* @param float $uCostEnergy the energy-cost for one unit/first level
* @param float $uCostFactor the cost-factor
*/
public function __construct(int $uUnitID, float $uCostMetal, float $uCostCrystal, float $uCostDeuterium,
float $uCostEnergy, float $uCostFactor) {
$this->unitID = $uUnitID;
$this->costMetal = $uCostMetal;
$this->costCrystal = $uCostCrystal;
$this->costDeuterium = $uCostDeuterium;
$this->costEnergy = $uCostEnergy;
$this->costFactor = $uCostFactor;
}
/**
* @return int the unit-id
*/
public function getUnitId() : int {
return $this->unitID;
}
/**
* @return float the cost for one unit / first level
*/
public function getCostMetal() : float {
return $this->costMetal;
}
/**
* @return float the cost for one unit / first level
*/
public function getCostCrystal() : float {
return $this->costCrystal;
}
/**
* @return float the cost for one unit / first level
*/
public function getCostDeuterium() : float {
return $this->costDeuterium;
}
/**
* @return float the cost for one unit / first level
*/
public function getCostEnergy() : float {
return $this->costEnergy;
}
/**
* @return float the cost-factor
*/
public function getFactor() : float {
return $this->costFactor;
}
}