| 1 | <?php |
||
| 14 | class OrientatedItem |
||
| 15 | { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var Item |
||
| 19 | */ |
||
| 20 | protected $item; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var int |
||
| 24 | */ |
||
| 25 | protected $width; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var int |
||
| 29 | */ |
||
| 30 | protected $length; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var int |
||
| 34 | */ |
||
| 35 | protected $depth; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Constructor. |
||
| 39 | * @param Item $item |
||
| 40 | * @param int $width |
||
| 41 | * @param int $length |
||
| 42 | * @param int $depth |
||
| 43 | */ |
||
| 44 | 29 | public function __construct(Item $item, $width, $length, $depth) { |
|
| 50 | |||
| 51 | /** |
||
| 52 | * Item |
||
| 53 | * |
||
| 54 | * @return Item |
||
| 55 | */ |
||
| 56 | 29 | public function getItem() { |
|
| 59 | |||
| 60 | /** |
||
| 61 | * Item width in mm in it's packed orientation |
||
| 62 | * |
||
| 63 | * @return int |
||
| 64 | */ |
||
| 65 | 29 | public function getWidth() { |
|
| 68 | |||
| 69 | /** |
||
| 70 | * Item length in mm in it's packed orientation |
||
| 71 | * |
||
| 72 | * @return int |
||
| 73 | */ |
||
| 74 | 29 | public function getLength() { |
|
| 77 | |||
| 78 | /** |
||
| 79 | * Item depth in mm in it's packed orientation |
||
| 80 | * |
||
| 81 | * @return int |
||
| 82 | */ |
||
| 83 | 29 | public function getDepth() { |
|
| 86 | |||
| 87 | /** |
||
| 88 | * Is this orientation stable (low centre of gravity) |
||
| 89 | * N.B. Assumes equal weight distribution |
||
| 90 | * |
||
| 91 | * @return bool |
||
| 92 | */ |
||
| 93 | 29 | public function isStable() { |
|
| 96 | } |
||
| 97 | |||
| 98 |