LasTres/lib/LasTres/Controller/Websocket/OutputPacket/Info.pm

66 lines
1.0 KiB
Perl

package LasTres::Controller::Websocket::OutputPacket::Info;
use v5.36.0;
use strict;
use warnings;
use feature 'signatures';
use Data::Dumper;
use Moo;
with 'LasTres::Controller::Websocket::OutputPacket';
has clear => (
is => 'rw',
);
has team_pjs => (
is => 'rw',
);
has location_data => (
is => 'rw',
);
has set_log => (
is => 'rw',
);
sub identifier {
return 'info';
}
sub data($self) {
my $clear = $self->clear;
my $team_pjs = $self->team_pjs;
my $location_data = $self->location_data;
my $set_log = $self->set_log;
return {
(
(defined $clear)
? (clear => $clear)
: ()
),
(
(defined $team_pjs)
? (team_pjs => $team_pjs)
: ()
),
(
(defined $location_data)
? (location_data => $location_data)
: ()
),
(
(defined $set_log)
? (set_log => [map { $_->hash } @$set_log])
: ()
)
};
}
1;