Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] connecting two rooms

  • Loading branch information...
commit 0e3976e9f5ae622e4b3c4d662f1d59be4b7ddd59 1 parent 88425cd
Carl Mäsak authored July 04, 2012

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

  1. 23  bin/crypt
23  bin/crypt
@@ -228,6 +228,17 @@ class Hanoi::Game {
228 228
     }
229 229
 }
230 230
 
  231
+class Adventure::TwoRoomsConnected does Event {
  232
+    has @.rooms;
  233
+    has $.direction;
  234
+}
  235
+
  236
+class Adventure::Engine {
  237
+    method connect(@rooms, $direction) {
  238
+        Adventure::TwoRoomsConnected.new(:@rooms, :$direction);
  239
+    }
  240
+}
  241
+
231 242
 class Crypt::PlayerLooked does Event {
232 243
     has $.target;
233 244
     has $.description_of;
@@ -423,6 +434,18 @@ multi MAIN('test') {
423 434
             ),
424 435
             'looking at the room';
425 436
     }
  437
+
  438
+    {
  439
+        my $engine = Adventure::Engine.new();
  440
+
  441
+        my @rooms = <kitchen veranda>;
  442
+        is $engine.connect(@rooms, my $direction = 'south'),
  443
+            Adventure::TwoRoomsConnected.new(
  444
+                :@rooms,
  445
+                :$direction,
  446
+            ),
  447
+            'connecting two rooms';
  448
+    }
426 449
 }
427 450
 
428 451
 multi MAIN('test', 'hanoi') {

0 notes on commit 0e3976e

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