Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[bin/crypt] refactored attribute name

  • Loading branch information...
commit 015b292d311ebac11c70158deac916fcbda3d655 1 parent 02858d2
Carl Mäsak authored

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

  1. 20  bin/crypt
20  bin/crypt
@@ -237,7 +237,7 @@ class Adventure::PlayerWasPlaced does Event {
237 237
 }
238 238
 
239 239
 class Adventure::PlayerLooked does Event {
240  
-    has $.description_of;
  240
+    has $.room;
241 241
     has @.exits;
242 242
 }
243 243
 
@@ -326,7 +326,7 @@ class Adventure::Engine {
326 326
         my @events = Adventure::PlayerWalked.new(:$to);
327 327
         unless %!seen_room{$to}++ {
328 328
             @events.push(Adventure::PlayerLooked.new(
329  
-                :description_of($to),
  329
+                :room($to),
330 330
                 :exits(%!exits{$to}.keys),
331 331
             ));
332 332
         }
@@ -336,7 +336,7 @@ class Adventure::Engine {
336 336
 
337 337
     method look() {
338 338
         my @events = Adventure::PlayerLooked.new(
339  
-            :description_of($!player_location),
  339
+            :room($!player_location),
340 340
             :exits(%!exits{$!player_location}.keys),
341 341
         );
342 342
         self!apply($_) for @events;
@@ -347,7 +347,7 @@ class Adventure::Engine {
347 347
         my @events = Adventure::PlayerWasPlaced.new(:$in);
348 348
         unless %!seen_room{$in}++ {
349 349
             @events.push(Adventure::PlayerLooked.new(
350  
-                :description_of($in),
  350
+                :room($in),
351 351
                 :exits(%!exits{$in}.keys),
352 352
             ));
353 353
         }
@@ -534,9 +534,9 @@ multi MAIN() {
534 534
                 my @events = $game.look;
535 535
                 for @events {
536 536
                     when Adventure::PlayerLooked {
537  
-                        say ucfirst .description_of;
  537
+                        say ucfirst .room;
538 538
                         say "";
539  
-                        say %descriptions{.description_of};
  539
+                        say %descriptions{.room};
540 540
                         if .exits {
541 541
                             say "You can go {join ' and ', .exits}.";
542 542
                         }
@@ -561,7 +561,7 @@ multi MAIN() {
561 561
                 for @events {
562 562
                     when Adventure::PlayerWalked { say ucfirst .to; say "" }
563 563
                     when Adventure::PlayerLooked {
564  
-                        say %descriptions{.description_of};
  564
+                        say %descriptions{.room};
565 565
                         if .exits {
566 566
                             say "You can go {join ' and ', .exits}.";
567 567
                         }
@@ -713,7 +713,7 @@ multi MAIN('test') {
713 713
 
714 714
         is $game.look(),
715 715
             Adventure::PlayerLooked.new(
716  
-                :description_of<clearing>,
  716
+                :room<clearing>,
717 717
                 :exits<east>,
718 718
             ),
719 719
             'looking at the room';
@@ -757,7 +757,7 @@ multi MAIN('test') {
757 757
                     :to<hill>,
758 758
                 ),
759 759
                 Adventure::PlayerLooked.new(
760  
-                    :description_of<hill>,
  760
+                    :room<hill>,
761 761
                     :exits<west>,
762 762
                 ),
763 763
             ],
@@ -835,7 +835,7 @@ multi MAIN('test') {
835 835
                     :to<inside>,
836 836
                 ),
837 837
                 Adventure::PlayerLooked.new(
838  
-                    :description_of<inside>,
  838
+                    :room<inside>,
839 839
                     :exits<northeast>,
840 840
                 ),
841 841
             ],

0 notes on commit 015b292

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