Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] player looks around

And sees a description of the clearing.
  • Loading branch information...
commit c848fd4cfe1ffabf0deb16c46ac7a173c7feec5b 1 parent 247f52c
Carl Mäsak authored July 03, 2012

Showing 1 changed file with 24 additions and 0 deletions. Show diff stats Hide diff stats

  1. 24  bin/crypt
24  bin/crypt
@@ -228,6 +228,17 @@ class Hanoi::Game {
228 228
     }
229 229
 }
230 230
 
  231
+class Crypt::PlayerLooked does Event {
  232
+    has $.target;
  233
+    has $.description_of;
  234
+}
  235
+
  236
+class Crypt::Game {
  237
+    method look() {
  238
+        Crypt::PlayerLooked.new(:target<room>, :description_of<clearing>);
  239
+    }
  240
+}
  241
+
231 242
 multi MAIN() {
232 243
     say "CRYPT";
233 244
     say "=====";
@@ -381,6 +392,19 @@ sub throws_exception(&code, $ex_type, $message, &followup?) {
381 392
     }
382 393
 }
383 394
 
  395
+multi MAIN('test') {
  396
+    {
  397
+        my $game = Crypt::Game.new();
  398
+
  399
+        is $game.look(),
  400
+            Crypt::PlayerLooked.new(
  401
+                :target('room'),
  402
+                :description_of<clearing>,
  403
+            ),
  404
+            'looking at the room';
  405
+    }
  406
+}
  407
+
384 408
 multi MAIN('test', 'hanoi') {
385 409
     {
386 410
         my $game = Hanoi::Game.new();

0 notes on commit c848fd4

Please sign in to comment.
Something went wrong with that request. Please try again.