示例#1
0
        private Dictionary<string, Response> _responses; //responses to commands

        #endregion Fields

        #region Constructors

        /// Initialize the command response mapping
        public CommandMapper(Game game)
        {
            _responses = new Dictionary<string, Response>();
             Response[] resp = {

            new QuitCommand(),
            new HelpCommand(_responses, this),
            new StatsCommand (game),
            new GearCommand (game),
             new PlayerCommand (game),
            new DiceCommand (),
            new DisplayCommand(game),
            new ChangeCommand(game),
            new ClearCommand(),
            new SaveCommand(game),
            new ResetCommand()

             };
             AllCommands = "";
             foreach (Response r in resp)
             {
            _responses[r.CommandName] = r;
            AllCommands += r.CommandName + " ";
             }
        }
示例#2
0
        public bool Execute(Command command)
        {
            Console.Clear();
            Game game = new Game(); //creates and plays new game
            game.play();

            return false;
        }
示例#3
0
 public PlayerCommand(Game game)
 {
     CommandName = "player";
     this._game = game;
 }
示例#4
0
 public SaveCommand(Game game)
 {
     this._game = game;
     CommandName = "save";
 }
示例#5
0
 public StatsCommand(Game game)
 {
     CommandName = "stats";
     this._game = game;
 }
示例#6
0
 public ChangeCommand(Game game)
 {
     CommandName = "change";
     this._game = game;
 }
示例#7
0
文件: Loader.cs 项目: chernandez7/DnD
 public Loader(Game game)
 {
     this._game = game;
 }
示例#8
0
文件: Game.cs 项目: chernandez7/DnD
        static int Main()
        {
            Console.SetWindowSize(Console.LargestWindowWidth - 5, Console.LargestWindowHeight - 5);
            Console.ForegroundColor = ConsoleColor.Yellow;

            Game _game = new Game();

            _game.play();

            return 0;
        }
示例#9
0
 public DisplayCommand(Game game)
 {
     CommandName = "display";
         this._game = game;
 }
示例#10
0
 public GearCommand(Game game)
 {
     CommandName = "gear";
     this._game = game;
 }