summaryrefslogtreecommitdiffstats
path: root/lib/Games/SMTNocturne/Demons
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-05-25 02:44:38 -0400
committerJesse Luehrs <doy@tozt.net>2014-05-25 02:44:38 -0400
commit3045b3176b0f9a2cc4574ac88a7a67c66038e972 (patch)
tree8606554032c35dd9357591f0e05a99e0dc59ed96 /lib/Games/SMTNocturne/Demons
parentef5e91f3d15e44c37d84b98e45da34181acd3d92 (diff)
downloadgames-smtnocturne-demons-3045b3176b0f9a2cc4574ac88a7a67c66038e972.tar.gz
games-smtnocturne-demons-3045b3176b0f9a2cc4574ac88a7a67c66038e972.zip
stringification
Diffstat (limited to 'lib/Games/SMTNocturne/Demons')
-rw-r--r--lib/Games/SMTNocturne/Demons/Demon.pm6
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__