| 1 | <?php |
||
| 16 | class OrientatedItem |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var Item |
||
| 20 | */ |
||
| 21 | protected $item; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var int |
||
| 25 | */ |
||
| 26 | protected $width; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var int |
||
| 30 | */ |
||
| 31 | protected $length; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var int |
||
| 35 | */ |
||
| 36 | protected $depth; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Constructor. |
||
| 40 | * |
||
| 41 | * @param Item $item |
||
| 42 | * @param int $width |
||
| 43 | * @param int $length |
||
| 44 | * @param int $depth |
||
| 45 | */ |
||
| 46 | public function __construct(Item $item, int $width, int $length, int $depth) |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Item. |
||
| 56 | * |
||
| 57 | * @return Item |
||
| 58 | */ |
||
| 59 | public function getItem(): Item |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Item width in mm in it's packed orientation. |
||
| 66 | * |
||
| 67 | * @return int |
||
| 68 | */ |
||
| 69 | public function getWidth(): int |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Item length in mm in it's packed orientation. |
||
| 76 | * |
||
| 77 | * @return int |
||
| 78 | */ |
||
| 79 | public function getLength(): int |
||
| 83 | |||
| 84 | /** |
||
| 85 | * Item depth in mm in it's packed orientation. |
||
| 86 | * |
||
| 87 | * @return int |
||
| 88 | */ |
||
| 89 | public function getDepth(): int |
||
| 93 | |||
| 94 | /** |
||
| 95 | * Is this orientation stable (low centre of gravity) |
||
| 96 | * N.B. Assumes equal weight distribution. |
||
| 97 | * |
||
| 98 | * @return bool |
||
| 99 | */ |
||
| 100 | public function isStable(): bool |
||
| 104 | } |
||
| 105 |