NAME

Box::Calc::Layer - A box is packed with multiple layers.

VERSION

version 1.0200

SYNOPSIS

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

METHODS

new(params)

Constructor.

NOTE: A layer is automatically created containing a single empty Box::Calc::Row.

max_x

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

max_y

The maximimum depth of the layer. This is equivalent to the y or middle dimension of the containing box.

fill_x()

Returns how full the layer is in the x dimension.

fill_y()

Returns how full the layer is in the y dimension.

fill_z()

Returns how full the layer is in the z dimension.

max_x()

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

max_y()

Returns the maximum y dimension of this layer. See new for details.

rows()

Returns an array reference of the list of Box::Calc::Row contained in this layer.

count_rows()

Returns the number of rows contained in this layer.

create_row()

Adds a new Box::Calc::Row to this layer.

calculate_weight()

Calculates and returns the weight of all the rows in this layer.

pack_item(item)

Add a Box::Calc::Item to this layer.

Returns 1 on success or 0 on failure.

item

The Box::Calc::Item instance you want to add to this layer.

packing_list(weight, list)

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

packing_instructions()

Returns a description of the layer.

{ fill_x => 3, fill_y => 3, fill_z => 1, rows => [ ... ], }