private Dictionary<string, Response> responses; //responses to commands

        #endregion Fields

        #region Constructors

        /// Initialize the command response mapping
        ///  game The game being played.
        public CommandMapper(Game game)
        {
            responses = new Dictionary<string, Response>();
             Response[] resp = {
            new Quitter(),
            new Goer(game),
            new Helper(responses, this)
            // add new Responses here!
             };
             AllCommands = "";
             foreach (Response r in resp) {
            responses[r.CommandName] = r;
            AllCommands += r.CommandName + " ";
             }
        }
Пример #2
0
 /// Constructor for objects of class Goer
 public Goer(Game game)
 {
     this.game = game;
      CommandName = "go";
 }
Пример #3
0
 /// Constructor for objects of class Goer
 public Goer(Game game)
 {
     this.game = game;
 }
Пример #4
0
 public static void Main(string[] args)
 {
     Game game = new Game();
      game.play();
 }