Skip to content

Commit

Permalink
[bin/crypt] taking, dropping, taking
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Masak committed Jul 15, 2012
1 parent bfdb350 commit e831985
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bin/crypt
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,9 @@ class Adventure::Engine {
when Adventure::PlayerTook {
%!thing_rooms{.thing} = 'player inventory';
}
when Adventure::PlayerDropped {
%!thing_rooms{.thing} = $!player_location;
}
}
}

Expand Down Expand Up @@ -1598,6 +1601,21 @@ multi MAIN('test') {
};
}

{
my $engine = Adventure::Engine.new();

$engine.place_thing('box', 'saloon');
$engine.make_thing_carryable('box');
$engine.place_player('saloon');
$engine.take('box');
$engine.drop('box');
is $engine.take('box'),
Adventure::PlayerTook.new(
:thing<box>,
),
'taking a thing (+) take, drop, take';
}

done;
}

Expand Down

0 comments on commit e831985

Please sign in to comment.