NAME

Games::Lacuna::Task::Role::Building - Helper methods for buildings

SYNOPSIS

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

DESCRIPTION

This role provides building-related helper methods.

METHODS

find_buildspot

my $avaliable_buildspots = $self->find_buildspot($planet_id);

Returns all available build spots as an Array Reference.

upgrade_building

my $upgrade_ok = $self->upgrade_building($planet_stats,$building_data);

Tries to upgrade the given building while performing various checks.

build_queue_size

my $count = $self->build_queue_size($planet_stats);

Calculates the build queue size

check_upgrade_building

my $is_upgradeable = $self->check_upgrade_building($planet_stats,$building_data);

Checks if a building is upgradeable