diff options
-rw-r--r-- | lib/Games/SMTNocturne/Demons/Demon.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Games/SMTNocturne/Demons/Demon.pm b/lib/Games/SMTNocturne/Demons/Demon.pm index 711697d..8ceff42 100644 --- a/lib/Games/SMTNocturne/Demons/Demon.pm +++ b/lib/Games/SMTNocturne/Demons/Demon.pm @@ -1,6 +1,7 @@ package Games::SMTNocturne::Demons::Demon; use strict; use warnings; +use overload '""' => 'to_string', fallback => 1; use JSON::PP; @@ -47,6 +48,11 @@ sub fusion_type { $_[0]->{fusion_type} } sub level { $_[0]->{level} } sub type { $_[0]->{type} } +sub to_string { + my $self = shift; + return '<' . $self->type . ' ' . $self->name . ' (' . $self->level . ')>' +} + 1; __DATA__ |