Skip to content
Permalink
Browse files

Game - properly handle coin drop

  • Loading branch information...
bobbymcr committed Dec 14, 2018
1 parent 3552afd commit 3ce8844642691039e7e1d40431cb28b76fd61678
Showing with 12 additions and 0 deletions.
  1. +6 −0 sample/src/Coin.cs
  2. +3 −0 sample/test/walkthrough.in
  3. +3 −0 sample/test/walkthrough.out
@@ -18,6 +18,12 @@ protected override bool TakeCore(MessageBus bus)
return base.TakeCore(bus);
}

protected override bool DropCore(MessageBus bus)
{
this.taken = false;
return base.DropCore(bus);
}

protected override bool DoCore(MessageBus bus, Word verb, Word noun)
{
if (verb.Primary == Verb.Read)
@@ -18,5 +18,8 @@ read coin
GET COIN
read coin
inv
THROW coin
read coin
take coin
exit
-- END --
@@ -24,4 +24,7 @@ There is a coin here.
> The inscription reads: "MCMXCIX"
> You are carrying:
a coin
> You THROW the coin.
> The writing is too small. You'd have to pick it up to see it better.
> You take the coin.
>

0 comments on commit 3ce8844

Please sign in to comment.
You can’t perform that action at this time.