File Coverage

blib/lib/WWW/MetaForge/ArcRaiders/Result/MapMarker.pm
Criterion Covered Total %
statement 15 15 100.0
branch 2 4 50.0
condition 1 2 50.0
subroutine 6 6 100.0
pod 3 3 100.0
total 27 30 90.0


line stmt bran cond sub pod time code
1             package WWW::MetaForge::ArcRaiders::Result::MapMarker;
2             our $AUTHORITY = 'cpan:GETTY';
3             # ABSTRACT: Map marker result object for ARC Raiders
4             our $VERSION = '0.002';
5 6     6   332112 use Moo;
  6         9251  
  6         45  
6 6     6   5085 use Types::Standard qw(Str Bool Maybe Int);
  6         158996  
  6         86  
7 6     6   16707 use namespace::clean;
  6         15901  
  6         48  
8              
9             extends 'WWW::MetaForge::GameMapData::Result::MapMarker';
10              
11             # ARC Raiders specific fields
12              
13             has category => (
14             is => 'ro',
15             isa => Maybe[Str],
16             );
17              
18             has subcategory => (
19             is => 'ro',
20             isa => Maybe[Str],
21             );
22              
23             has instanceName => (
24             is => 'ro',
25             isa => Maybe[Str],
26             );
27              
28             has behindLockedDoor => (
29             is => 'ro',
30             isa => Bool,
31             coerce => sub { $_[0] ? 1 : 0 },
32             );
33              
34             has eventConditionMask => (
35             is => 'ro',
36             isa => Maybe[Int],
37             );
38              
39             has lootAreas => (
40             is => 'ro',
41             # Can be null, string, or array depending on marker type
42             );
43              
44             sub from_hashref {
45 1665     1665 1 36548 my ($class, $data) = @_;
46              
47             return $class->new(
48             # Base class fields
49             id => $data->{id},
50             lat => $data->{lat},
51             lng => $data->{lng},
52             zlayers => $data->{zlayers},
53             mapID => $data->{mapID},
54             updated_at => $data->{updated_at},
55             added_by => $data->{added_by},
56             last_edited_by => $data->{last_edited_by},
57             _raw => $data,
58             # ARC Raiders specific
59             category => $data->{category},
60             subcategory => $data->{subcategory},
61             instanceName => $data->{instanceName},
62             behindLockedDoor => $data->{behindLockedDoor} // 0,
63             eventConditionMask => $data->{eventConditionMask},
64             lootAreas => $data->{lootAreas},
65 1665   50     38867 );
66             }
67              
68             # Convenience accessors
69              
70             sub type {
71 1     1 1 3920 my ($self) = @_;
72 1 50       5 return undef unless $self->category;
73 1 50       9 return $self->subcategory
74             ? $self->category . '/' . $self->subcategory
75             : $self->category;
76             }
77              
78 2     2 1 5816 sub name { shift->instanceName }
79              
80             1;
81              
82             __END__
83              
84             =pod
85              
86             =encoding UTF-8
87              
88             =head1 NAME
89              
90             WWW::MetaForge::ArcRaiders::Result::MapMarker - Map marker result object for ARC Raiders
91              
92             =head1 VERSION
93              
94             version 0.002
95              
96             =head1 SYNOPSIS
97              
98             my $markers = $api->map_data(map => 'dam');
99             for my $marker (@$markers) {
100             say $marker->category . '/' . $marker->subcategory;
101             say " (" . $marker->lng . ", " . $marker->lat . ")";
102             say " Behind locked door" if $marker->behindLockedDoor;
103             }
104              
105             =head1 DESCRIPTION
106              
107             Represents a map marker from the ARC Raiders game maps.
108              
109             Extends L<WWW::MetaForge::GameMapData::Result::MapMarker> with
110             ARC Raiders specific attributes.
111              
112             =head1 INHERITED ATTRIBUTES
113              
114             See L<WWW::MetaForge::GameMapData::Result::MapMarker> for base attributes
115             (id, lat, lng, zlayers, mapID, updated_at, added_by, last_edited_by).
116              
117             =head2 category
118              
119             Marker category (e.g., "arc", "containers", "locations", "events").
120              
121             =head2 subcategory
122              
123             Marker subcategory (e.g., "tick", "pop", "base_container", "player_spawn").
124              
125             =head2 instanceName
126              
127             Optional instance name for the marker.
128              
129             =head2 behindLockedDoor
130              
131             Boolean indicating if marker is behind a locked door.
132              
133             =head2 eventConditionMask
134              
135             Event condition bitmask.
136              
137             =head2 lootAreas
138              
139             Loot area data (can be null, string, or array).
140              
141             =head2 type
142              
143             Returns "category/subcategory" string.
144              
145             =head2 name
146              
147             Alias for C<instanceName>.
148              
149             =head1 SUPPORT
150              
151             =head2 Issues
152              
153             Please report bugs and feature requests on GitHub at
154             L<https://github.com/Getty/p5-www-metaforge/issues>.
155              
156             =head2 IRC
157              
158             You can reach Getty on C<irc.perl.org> for questions and support.
159              
160             =head1 CONTRIBUTING
161              
162             Contributions are welcome! Please fork the repository and submit a pull request.
163              
164             =head1 AUTHOR
165              
166             Torsten Raudssus <torsten@raudssus.de>
167              
168             =head1 COPYRIGHT AND LICENSE
169              
170             This software is copyright (c) 2026 by Torsten Raudssus.
171              
172             This is free software; you can redistribute it and/or modify it under
173             the same terms as the Perl 5 programming language system itself.
174              
175             =cut