1 | <?php |
||
15 | class PackedItem |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * @var int |
||
20 | */ |
||
21 | protected $x; |
||
22 | |||
23 | /** |
||
24 | * @var int |
||
25 | */ |
||
26 | protected $y; |
||
27 | |||
28 | /** |
||
29 | * @var int |
||
30 | */ |
||
31 | protected $z; |
||
32 | |||
33 | /** |
||
34 | * @var Item |
||
35 | */ |
||
36 | protected $item; |
||
37 | |||
38 | /** |
||
39 | * @var int |
||
40 | */ |
||
41 | protected $width; |
||
42 | |||
43 | /** |
||
44 | * @var int |
||
45 | */ |
||
46 | protected $length; |
||
47 | |||
48 | /** |
||
49 | * @var int |
||
50 | */ |
||
51 | protected $depth; |
||
52 | |||
53 | /** |
||
54 | * PackedItem constructor. |
||
55 | * |
||
56 | * @param Item $item |
||
57 | * @param int $x |
||
58 | * @param int $y |
||
59 | * @param int $z |
||
60 | * @param int $width |
||
61 | * @param int $length |
||
62 | * @param int $depth |
||
63 | */ |
||
64 | 39 | public function __construct(Item $item, int $x, int $y, int $z, int $width, int $length, int $depth) |
|
74 | |||
75 | /** |
||
76 | * @return int |
||
77 | */ |
||
78 | 12 | public function getX(): int |
|
82 | |||
83 | /** |
||
84 | * @return int |
||
85 | */ |
||
86 | 12 | public function getY(): int |
|
90 | |||
91 | /** |
||
92 | * @return int |
||
93 | */ |
||
94 | 12 | public function getZ(): int |
|
98 | |||
99 | /** |
||
100 | * @return Item |
||
101 | */ |
||
102 | 30 | public function getItem(): Item |
|
106 | |||
107 | /** |
||
108 | * @return int |
||
109 | */ |
||
110 | 13 | public function getWidth(): int |
|
114 | |||
115 | /** |
||
116 | * @return int |
||
117 | */ |
||
118 | 13 | public function getLength(): int |
|
122 | |||
123 | /** |
||
124 | * @return int |
||
125 | */ |
||
126 | 13 | public function getDepth(): int |
|
130 | |||
131 | |||
132 | /** |
||
133 | * @param OrientatedItem $orientatedItem |
||
134 | * @param int $x |
||
135 | * @param int $y |
||
136 | * @param int $z |
||
137 | * |
||
138 | * @return PackedItem |
||
139 | */ |
||
140 | 39 | public static function fromOrientatedItem(OrientatedItem $orientatedItem, int $x, int $y, int $z): PackedItem |
|
152 | |||
153 | /** |
||
154 | * @return OrientatedItem |
||
155 | */ |
||
156 | 32 | public function toOrientatedItem(): OrientatedItem |
|
160 | } |
||
161 | |||
162 |