Skip to content
Permalink
Browse files

Game - use Item.Taken in Coin, remove custom code

  • Loading branch information...
bobbymcr committed Dec 22, 2018
1 parent 4eab90e commit f8828f9d43100949fdb3b6d31ff1b7a3d3a7d0e1
Showing with 1 addition and 15 deletions.
  1. +1 −15 sample/src/Coin.cs
@@ -6,8 +6,6 @@ namespace Adventure.Sample
{
internal sealed class Coin : Item
{
private bool taken;

public Coin(MessageBus bus)
: base(bus)
{
@@ -17,18 +15,6 @@ public Coin(MessageBus bus)

public override string LongDescription => "It is a small gold coin with an inscription on the edge.";

protected override bool TakeCore()
{
this.taken = true;
return base.TakeCore();
}

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

protected override bool DoCore(Word verb, Word noun)
{
if (verb.Primary == Verb.Read)
@@ -42,7 +28,7 @@ protected override bool DoCore(Word verb, Word noun)

private void Read()
{
if (this.taken)
if (this.Taken)
{
this.Output("The inscription reads: \"MCMXCIX\"");
}

0 comments on commit f8828f9

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