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 data has [Required]
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 [Required]
If true will not build new ships if there are matchig ships currently travelling
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.
Pushes the selected ships from one body to another