-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgalaxy.php
78 lines (62 loc) · 2.03 KB
/
galaxy.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
<?php
declare(strict_types = 1);
defined('INSIDE') OR exit('No direct script access allowed');
/**
* This class maps the 'galaxy'-table to an php object.
*/
class D_Galaxy {
/** @var int Amount of Metal in the Debris */
private $debris_metal;
/** @var int Amount of Crystal in the Debris */
private $debris_crystal;
/**
* D_Galaxy constructor.
* @param int $gdebris_metal the amount of metal in the debris
* @param int $gdebris_crystal the amount of crystal in the debris
*/
public function __construct(int $gdebris_metal, int $gdebris_crystal) {
$this->debris_metal = $gdebris_metal;
$this->debris_crystal = $gdebris_crystal;
}
/**
* Prints the object to the page
* @codeCoverageIgnore
*/
public function print() : void {
echo '<pre>';
print_r($this);
echo '</pre>';
}
/**
* Returns the amount of metal in the debris
* @return int the current amont
*/
public function getDebrisMetal() : int {
return $this->debris_metal;
}
/**
* Sets the amount of metal in the debris
* @param int metal in the debris
*/
public function setDebrisMetal(int $debris_metal) : void {
if ($debris_metal >= 0) {
$this->debris_metal = $debris_metal;
}
}
/**
* Returns the amount of crystal in the debris
* @return int crystal in the debris
*/
public function getDebrisCrystal() : int {
return $this->debris_crystal;
}
/**
* * Sets the amount of crystal in the debris
* @param int crystal in the debris
*/
public function setDebrisCrystal(int $debris_crystal) : void {
if ($debris_crystal >= 0) {
$this->debris_crystal = $debris_crystal;
}
}
}