Skip to content
Permalink
Browse files

Game - change Noun from static to instance class

  • Loading branch information...
bobbymcr committed Dec 19, 2018
1 parent 5a458ec commit 92efc0d2f085b03057569db651683d1d9973c21f
Showing with 14 additions and 5 deletions.
  1. +14 −5 sample/src/Noun.cs
@@ -4,11 +4,20 @@

namespace Adventure.Sample
{
internal static class Noun
internal sealed class Noun
{
public const string Coin = "coin";
public const string East = "east";
public const string Table = "table";
public const string West = "west";
public static readonly Noun Coin = new Noun("coin");
public static readonly Noun East = new Noun("east");
public static readonly Noun Table = new Noun("table");
public static readonly Noun West = new Noun("west");

private readonly string noun;

private Noun(string noun)
{
this.noun = noun;
}

public static implicit operator string(Noun n) => n.noun;
}
}

0 comments on commit 92efc0d

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