Skip to content
Permalink
Browse files

Game - change Verb from static to instance class

  • Loading branch information...
bobbymcr committed Dec 19, 2018
1 parent 92efc0d commit 90ad6293152ec110bd770617f8ee6ab980665173
Showing with 19 additions and 10 deletions.
  1. +19 −10 sample/src/Verb.cs
@@ -4,16 +4,25 @@

namespace Adventure.Sample
{
internal static class Verb
internal sealed class Verb
{
public const string Drop = "drop";
public const string Go = "go";
public const string Greet = "greet";
public const string Inventory = "inventory";
public const string Look = "look";
public const string Move = "move";
public const string Take = "take";
public const string Quit = "quit";
public const string Read = "read";
public static readonly Verb Drop = new Verb("drop");
public static readonly Verb Go = new Verb("go");
public static readonly Verb Greet = new Verb("greet");
public static readonly Verb Inventory = new Verb("inventory");
public static readonly Verb Look = new Verb("look");
public static readonly Verb Move = new Verb("move");
public static readonly Verb Take = new Verb("take");
public static readonly Verb Quit = new Verb("quit");
public static readonly Verb Read = new Verb("read");

private readonly string verb;

private Verb(string verb)
{
this.verb = verb;
}

public static implicit operator string(Verb v) => v.verb;
}
}

0 comments on commit 90ad629

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