Games::Lacuna::Task::Role::Ships - Helper methods for fetching and building ships
package Games::Lacuna::Task::Action::MyTask; use Moose; extends qw(Games::Lacuna::Task::Action); with qw(Games::Lacuna::Task::Role::Ships);
This role provides ship-related helper methods.
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
planet
Planet data has [Required]
ships_needed
Number of required ships. If ships_needed is a negative number it will return all matching ships and build as many new ships as possible while keeping ships_needed * -1 space port slots free [Required]
ship_type
Ship type [Required]
travelling
If true will not build new ships if there are matchig ships currently travelling
name_prefix
Will only return ships with the given prefix in their names. Newly built ships will be renamed to add the prefix.
my $trade_ships = $self->trade_ships($body_id,$cargo_list);
Returns a hashref with cargo ship ids as keys and cargo lists as values.
$self->push_ships($from_body_id,$to_body_id,\@ships);
Pushes the selected ships from one body to another
To install Games::Lacuna::Task, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Lacuna::Task
CPAN shell
perl -MCPAN -e shell install Games::Lacuna::Task
For more information on module installation, please visit the detailed CPAN module installation guide.