NAME

Box::Calc::Row - The smallest organizational unit in a box.

VERSION

version 1.0200

SYNOPSIS

my $row = Box::Calc::Row->new(max_x => 6);

METHODS

new(params)

Constructor.

max_x

The maximimum width of the row. This is equivalent to the x or longest dimension of the containing box.

fill_weight()

Returns the weight of the items in this row.

fill_x()

Returns how full the row is in the x dimension.

fill_y()

Returns how full the row is in the y dimension.

fill_z()

Returns how full the row is in the z dimension.

max_x()

Returns the maximum x dimension of this row. See new for details.

items()

Returns an array reference of items contained in this row.

count_items()

Returns the number of items contained in this row.

calculate_weight()

Calculates the weight of all the items in this row, and returns that value.

pack_item(item)

Places an item into the row, and updates all the relevant statistics about the row.

Returns 1 on success or 0 on failure.

item

A Box::Calc::Item instance.

packing_list(weight, list)

Updates a scalar reference with the weight of the row and a hash reference of all the items in this row.

packing_instructions()

Returns a hash reference of items contained in this row via the describe method, and other important info about the row. Example:

{
  items => [ ... ],
  x     => 3,
  y     => 2,
  z     => 2
}