Created
March 4, 2013 18:39
-
-
Save tadzik/5084382 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Quest::EventFactory; | |
has @!events = <Nothing TreasureChest>; | |
method get-event { | |
my $class = "Quest::Event::{@!events.pick}"; | |
note "Loading $class"; | |
require $class; | |
note ::($class).perl; | |
my $ret = ::($class).new; | |
note "returning {$ret.perl}"; | |
$ret; | |
} | |
... later ... | |
Loading Quest::Event::TreasureChest | |
Failure.new(exception => X::NoSuchSymbol.new(symbol => "Quest::Event::TreasureChest")) | |
Not enough positional parameters passed; got 1 but expected 2 | |
in method new at src/gen/CORE.setting:10494 | |
in method get-event at lib/Quest/EventFactory.pm:10 | |
in method step at lib/Quest/Game.pm:20 | |
in block at bin/quest:15 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment