Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] implemented walking

  • Loading branch information...
commit 4b468fb3606bffe1f15dd1e9bb88101427d748ce 1 parent 7d02b68
Carl Mäsak authored July 04, 2012

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

  1. 18  bin/crypt
18  bin/crypt
@@ -264,10 +264,18 @@ class Crypt::PlayerLooked does Event {
264 264
     has $.description_of;
265 265
 }
266 266
 
  267
+class Crypt::PlayerWalked does Event {
  268
+    has $.to;
  269
+}
  270
+
267 271
 class Crypt::Game {
268 272
     method look() {
269 273
         Crypt::PlayerLooked.new(:target<room>, :description_of<clearing>);
270 274
     }
  275
+
  276
+    method walk($direction) {
  277
+        Crypt::PlayerWalked.new(:to<hill>);
  278
+    }
271 279
 }
272 280
 
273 281
 multi MAIN() {
@@ -485,6 +493,16 @@ multi MAIN('test') {
485 493
             };
486 494
     }
487 495
 
  496
+    {
  497
+        my $game = Crypt::Game.new();
  498
+
  499
+        is $game.walk('east'),
  500
+            Crypt::PlayerWalked.new(
  501
+                :to<hill>,
  502
+            ),
  503
+            'walking east to the hill';
  504
+    }
  505
+
488 506
     done;
489 507
 }
490 508
 

0 notes on commit 4b468fb

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