Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[bin/crypt] connecting two rooms

  • Loading branch information...
commit 0e3976e9f5ae622e4b3c4d662f1d59be4b7ddd59 1 parent 88425cd
@masak authored
Showing with 23 additions and 0 deletions.
  1. +23 −0 bin/crypt
View
23 bin/crypt
@@ -228,6 +228,17 @@ class Hanoi::Game {
}
}
+class Adventure::TwoRoomsConnected does Event {
+ has @.rooms;
+ has $.direction;
+}
+
+class Adventure::Engine {
+ method connect(@rooms, $direction) {
+ Adventure::TwoRoomsConnected.new(:@rooms, :$direction);
+ }
+}
+
class Crypt::PlayerLooked does Event {
has $.target;
has $.description_of;
@@ -423,6 +434,18 @@ multi MAIN('test') {
),
'looking at the room';
}
+
+ {
+ my $engine = Adventure::Engine.new();
+
+ my @rooms = <kitchen veranda>;
+ is $engine.connect(@rooms, my $direction = 'south'),
+ Adventure::TwoRoomsConnected.new(
+ :@rooms,
+ :$direction,
+ ),
+ 'connecting two rooms';
+ }
}
multi MAIN('test', 'hanoi') {

0 comments on commit 0e3976e

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