Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[bin/crypt] implemented walking

  • Loading branch information...
commit 4b468fb3606bffe1f15dd1e9bb88101427d748ce 1 parent 7d02b68
@masak authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 bin/crypt
View
18 bin/crypt
@@ -264,10 +264,18 @@ class Crypt::PlayerLooked does Event {
has $.description_of;
}
+class Crypt::PlayerWalked does Event {
+ has $.to;
+}
+
class Crypt::Game {
method look() {
Crypt::PlayerLooked.new(:target<room>, :description_of<clearing>);
}
+
+ method walk($direction) {
+ Crypt::PlayerWalked.new(:to<hill>);
+ }
}
multi MAIN() {
@@ -485,6 +493,16 @@ multi MAIN('test') {
};
}
+ {
+ my $game = Crypt::Game.new();
+
+ is $game.walk('east'),
+ Crypt::PlayerWalked.new(
+ :to<hill>,
+ ),
+ 'walking east to the hill';
+ }
+
done;
}
Please sign in to comment.
Something went wrong with that request. Please try again.