package LasTres::Controller::Websocket::InputPackets;

use v5.36.0;

use strict;
use warnings;

use Moo;

use Module::Pluggable search_path => ['LasTres::Controller::Websocket::InputPacket'],
    instantiate => 'new',
    on_require_error => sub ($plugin, $error) {
        die $error;
    };


has hash => (
    is => 'lazy',
);

sub _build_hash($self) {
    my %hash;
    for my $packet ($self->plugins()) {
        $hash{$packet->identifier} = $packet;
    }
    return \%hash;
}
1;
