| 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 | 33 | public function __construct(Item $item, $width, $length, $depth) { |
|
| 45 | 33 | $this->item = $item; |
|
| 46 | 33 | $this->width = $width; |
|
| 47 | 33 | $this->length = $length; |
|
| 48 | 33 | $this->depth = $depth; |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Item |
||
| 53 | * |
||
| 54 | * @return Item |
||
| 55 | */ |
||
| 56 | 33 | public function getItem() { |
|
| 57 | 33 | return $this->item; |
|
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Item width in mm in it's packed orientation |
||
| 62 | * |
||
| 63 | * @return int |
||
| 64 | */ |
||
| 65 | 33 | public function getWidth() { |
|
| 66 | 33 | return $this->width; |
|
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Item length in mm in it's packed orientation |
||
| 71 | * |
||
| 72 | * @return int |
||
| 73 | */ |
||
| 74 | 33 | public function getLength() { |
|
| 75 | 33 | return $this->length; |
|
| 76 | } |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Item depth in mm in it's packed orientation |
||
| 80 | * |
||
| 81 | * @return int |
||
| 82 | */ |
||
| 83 | 33 | public function getDepth() { |
|
| 84 | 33 | return $this->depth; |
|
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * Is this orientation stable (low centre of gravity) |
||
| 89 | * N.B. Assumes equal weight distribution |
||
| 90 | * |
||
| 91 | * @return bool |
||
| 92 | */ |
||
| 93 | 33 | public function isStable() { |
|
| 96 | } |
||
| 97 | |||
| 98 |