From bfb381b794062830a33eab3739e23a7204fdeebf Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 25 May 2014 02:45:41 -0400 Subject: method to get all demons of a given type --- lib/Games/SMTNocturne/Demons/Demon.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/Games') diff --git a/lib/Games/SMTNocturne/Demons/Demon.pm b/lib/Games/SMTNocturne/Demons/Demon.pm index 1cf2bf1..81114a8 100644 --- a/lib/Games/SMTNocturne/Demons/Demon.pm +++ b/lib/Games/SMTNocturne/Demons/Demon.pm @@ -43,6 +43,14 @@ sub from_type_and_level { return $found; } +sub from_type { + my ($class, $type) = @_; + + die "unknown type $type" unless $DEMONS_BY_TYPE{$type}; + + return @{ $DEMONS_BY_TYPE{$type} }; +} + # sub boss { $_[0]->{boss} } sub fusion_type { $_[0]->{fusion_type} } sub level { $_[0]->{level} } -- cgit v1.2.3