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

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

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Games::Lacuna::Task::Role::Ships - Helper methods for fetching and building ships

SYNOPSIS ^

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

DESCRIPTION ^

This role provides ship-related helper methods.

METHODS ^

get_ships

    my @avaliable_scows = $self->get_ships(
        planet          => $planet_stats,
        ships_needed    => 3, # get three
        ship_type       => 'scow',
    );

Tries to fetch the given number of available ships. If there are not enough ships available then the required number of ships are built.

The following arguments are accepted

trade_ships

 my $trade_ships = $self->trade_ships($body_id,$cargo_list);

Returns a hashref with cargo ship ids as keys and cargo lists as values.

push_ships

 $self->push_ships($from_body_id,$to_body_id,\@ships);

Pushes the selected ships from one body to another

syntax highlighting: