package LasTres::Planet::Bahdder::BosqueDelHeroe::TribuDeLaLima;

use v5.36.0;

use strict;
use warnings;

use feature 'signatures';

use Module::Pluggable search_path => ['LasTres::Planet::Bahdder::BosqueDelHeroe::TribuDeLaLima'],
    instantiate => 'instance',
    on_require_error => sub ($plugin, $error) {
        die $error;
    };

use Moo;
use LasTres::Planet::Bahdder::BosqueDelHeroe;

has locations => (
    is => 'ro',
    builder => \&_build_locations,
    lazy => 1,
);

has identifier => (
    is => 'ro',
    builder => \&_build_identifier,
);

has name => (
    is => 'ro',
    builder => \&_build_name,
);

has parent => (
    is => 'ro',
    builder => \&_build_parent,
);

with 'LasTres::Area';

sub _build_identifier {
    return 'tribu_de_la_lima';
}

sub _build_locations {
    my $self = shift;
    my $hash = {};
    my @locations = $self->plugins();
    for my $location (@locations) {
        $hash->{$location->identifier} = $location;
    }
    return $hash;
}

sub _build_name {
    return 'Tribu de la Lima';
}

sub _build_parent {
    return LasTres::Planet::Bahdder::BosqueDelHeroe->instance;
}

my $singleton;
sub instance {
    my $class = shift;
    if (!defined $singleton) {
        $singleton = $class->new(@_);
    }
    return $singleton;
}
1;
