Permalink
Browse files

rename Crypt::Game->Game::Crypt, Hanoi::Game->Game::Hanoi

  • Loading branch information...
1 parent 9397b25 commit 99be19c8b2d89c950f11d8e601ccaa955b2322bb @masak committed Aug 4, 2012
Showing with 190 additions and 194 deletions.
  1. +2 −2 META.info
  2. +7 −7 bin/crypt
  3. +6 −6 lib/{Crypt/Game.pm → Game/Crypt.pm}
  4. +128 −132 lib/{Hanoi/Game.pm → Game/Hanoi.pm}
  5. +26 −26 t/crypt.t
  6. +21 −21 t/hanoi.t
View
@@ -1,6 +1,6 @@
{
- "name" : "Crypt::Game",
- "version" : "0.2.0",
+ "name" : "Game::Crypt",
+ "version" : "0.2.1",
"description" : "An adventure game.",
"author" : "Carl Mäsak",
"depends" : ["Adventure::Engine"],
View
@@ -1,7 +1,7 @@
#! /usr/local/bin/nom
use Test;
-use Crypt::Game;
+use Game::Crypt;
sub MAIN {
say "CRYPT";
@@ -13,7 +13,7 @@ sub MAIN {
say "to find out...";
say "";
- my $game = Crypt::Game.new();
+ my $game = Game::Crypt.new();
my $save;
my %descriptions;
for slurp("game-data/descriptions").trim.split(/\n\n/) {
@@ -106,7 +106,7 @@ inventory";
say "";
say %descriptions{.room};
if .room eq 'hall' {
- Hanoi::print_hanoi_game(@all_events);
+ Game::Hanoi::print_hanoi_game(@all_events);
say "";
}
for .things -> $thing {
@@ -219,7 +219,7 @@ inventory";
say "";
say %descriptions{.room};
if .room eq 'hall' {
- Hanoi::print_hanoi_game(@all_events);
+ Game::Hanoi::print_hanoi_game(@all_events);
say "";
}
for .things -> $thing {
@@ -273,7 +273,7 @@ inventory";
say "You put the {.thing} on the {.on}.";
if .thing eq 'tiny disk' && .on ~~ /' rod'/ {
$player_has_tiny_disk = False;
- Hanoi::print_hanoi_game(@all_events);
+ Game::Hanoi::print_hanoi_game(@all_events);
say "";
}
}
@@ -283,9 +283,9 @@ inventory";
when Adventure::PlayerRead {
say %descriptions{"{.thing}"};
}
- when Hanoi::DiskMoved {
+ when Game::Hanoi::DiskMoved {
say "You put the {.disk} on the {.target} rod.";
- Hanoi::print_hanoi_game(@all_events);
+ Game::Hanoi::print_hanoi_game(@all_events);
}
when Adventure::PlayerCheckedInventory {
if .things {
@@ -1,13 +1,13 @@
use Adventure::Engine;
-use Hanoi::Game;
+use Game::Hanoi;
class X::Crypt is Exception {
}
class X::Crypt::NoDisksHere is X::Crypt {
}
-class Crypt::Game {
+class Game::Crypt {
has $!engine;
has $!hanoi;
has $!player_location;
@@ -129,7 +129,7 @@ class Crypt::Game {
when 'tiny disk' {
my @events = $!hanoi.add: $_, $rod.words[0];
for @events {
- when Hanoi::AchievementUnlocked {
+ when Game::Hanoi::AchievementUnlocked {
push @events,
$!engine.remark('floor-reveals-hole'),
$!engine.connect(<hall cave>, 'down');
@@ -189,7 +189,7 @@ class Crypt::Game {
.place_player: $!player_location = 'clearing';
}
- $!hanoi = Hanoi::Game.new();
+ $!hanoi = Game::Hanoi.new();
}
method look {
@@ -251,12 +251,12 @@ class Crypt::Game {
my @events = $!hanoi.move($source, $target);
for @events {
- when Hanoi::AchievementUnlocked {
+ when Game::Hanoi::AchievementUnlocked {
push @events,
$!engine.remark('floor-reveals-hole'),
$!engine.connect(<hall cave>, 'down');
}
- when Hanoi::AchievementLocked {
+ when Game::Hanoi::AchievementLocked {
push @events,
$!engine.remark('floor-hides-hole'),
$!engine.disconnect(<hall cave>, 'down');
Oops, something went wrong.

0 comments on commit 99be19c

Please sign in to comment.