line |
l |
!l&&r |
!l&&!r |
condition |
165
|
1 |
1 |
204 |
not defined $type or ref $type |
180
|
153 |
0 |
2 |
ref $component || Carp::croak('Component must be a reference') |
279
|
18 |
1 |
0 |
$self->{'entities'}[$pos] // $guid + 1 |
283
|
6 |
0 |
0 |
$self->{'components'}{$name} // Carp::croak("Cannot sort ${name}: no such component in registry") |
296
|
4 |
0 |
0 |
$self->{'components'}{$comparator} // Carp::croak("Cannot sort according to ${comparator}: no such component in registry") |
387
|
4 |
9 |
0 |
$self->{'view_cache'}{"|$name|"} //= do {
my $set = $self->{'components'}{$name};
my $comps = $set->[2];
'Game::Entities::View'->new(map({my($i, $e) = ($_, $set->[1][$_]);
$self->$add_version($e), [$comps->[$i]];} 0 .. $#{$$set[1];}))
} |
401
|
3 |
3 |
0 |
$self->{'view_cache'}{'|' . join('|', @types) . '|'} //= do {
my $map = $self->{'components'};
my($short, @rest) = (sort {@{$map->{$a}[1] // [];} <=> @{$map->{$b}[1] // [];};} @types);
my $set = $self->{'components'}{$short};
my $comps = $set->[2];
my @view;
while (my($i, $e) = each @{$$set[1];}) {
do {
my $guid = $self->$add_version($e);
next unless &List::Util::all(sub {
$self->check($guid, $_);
}
, @rest);
push @view, $guid, [map({$_ eq $short ? $comps->[$i] : $self->$get(1, $guid, $_);} @types)]
};
};
'Game::Entities::View'->new(@view)
} |
446
|
4 |
0 |
0 |
not @types or @names > 1 |