Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[bin/crypt] player looks around

And sees a description of the clearing.
  • Loading branch information...
commit c848fd4cfe1ffabf0deb16c46ac7a173c7feec5b 1 parent 247f52c
@masak authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 bin/crypt
View
24 bin/crypt
@@ -228,6 +228,17 @@ class Hanoi::Game {
}
}
+class Crypt::PlayerLooked does Event {
+ has $.target;
+ has $.description_of;
+}
+
+class Crypt::Game {
+ method look() {
+ Crypt::PlayerLooked.new(:target<room>, :description_of<clearing>);
+ }
+}
+
multi MAIN() {
say "CRYPT";
say "=====";
@@ -381,6 +392,19 @@ sub throws_exception(&code, $ex_type, $message, &followup?) {
}
}
+multi MAIN('test') {
+ {
+ my $game = Crypt::Game.new();
+
+ is $game.look(),
+ Crypt::PlayerLooked.new(
+ :target('room'),
+ :description_of<clearing>,
+ ),
+ 'looking at the room';
+ }
+}
+
multi MAIN('test', 'hanoi') {
{
my $game = Hanoi::Game.new();
Please sign in to comment.
Something went wrong with that request. Please try again.