Navigation Menu

Skip to content

Commit

Permalink
Game - change Noun from static to instance class
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbymcr committed Dec 19, 2018
1 parent 5a458ec commit 92efc0d
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions sample/src/Noun.cs
Expand Up @@ -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.