Maroš Kollár > Games-Lacuna-Task > Games::Lacuna::Task::Role::Storage

Download:
Games-Lacuna-Task-2.05.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Games::Lacuna::Task::Role::Storage - Storage helper methods

SYNOPSIS ^

    package Games::Lacuna::Task::Action::MyTask;
    use Moose;
    extends qw(Games::Lacuna::Task::Action);
    with qw(Games::Lacuna::Task::Role::Storage);

DESCRIPTION ^

This role provides helper method to query storage buildings.

METHODS ^

resource_type

 my $type = $self->resource_type('magnetite');
 # $type is 'ore'

Returns the type of the requested resource

check_stored

 my $quantity1 = $self->resource_type($planet_stats,'magnetite');
 my $quantity2 = $self->resource_type($planet_stats,'water');

Returns the stored quantity for the given resource

food_stored

 $self->food_stored($planet_id);

Returns a hashref of all stored foods

ore_stored

 $self->ore_stored($planet_id);

Returns a hashref of all stored ores

plans_stored

 $self->ore_stored($planet_id);

Returns an arrayref of all stored plans

_resource_stored

 $self->_resource_stored($planet_id,'ore','OreStorage');

Helper method to query storage building for details.

syntax highlighting: