Ninja/Action.pm untested

filter: Statementstmt 0.0% 0 / 3 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 5 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
CRAP 2.0
1 sub new {
2 ### an Action is based around 2 entities and has several
3 ### hitting functors, one one which entity1 is hit and another
4 ### on which it is hit
5 ### entity2 is on which you hit with entity1
6  
7 ### NOTE that both actions can be at the same time to care
8 ### for defense, god mode etc. Actions' functors can e.g. use
9 ### the Metropolis algorithm in this codebase wrapped in the functor.
10  
11 my ($class, $entity1, $entity2, $hitf, $tohitf) = @_;
12  
13 $self = { playerentity => $entity1, adversaryentity => $entity2,
14 hitmethod => $hitf, tohitmethod => $tohitf, };
15  
16 bless $self, $class;
17 };
18  
19 1;