Exemplo n.º 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 + " ";
             }
        }
Exemplo n.º 2
0
        public bool Execute(Command command)
        {
            Console.Clear();
            Game game = new Game(); //creates and plays new game
            game.play();

            return false;
        }
Exemplo n.º 3
0
 public PlayerCommand(Game game)
 {
     CommandName = "player";
     this._game = game;
 }
Exemplo n.º 4
0
 public SaveCommand(Game game)
 {
     this._game = game;
     CommandName = "save";
 }
Exemplo n.º 5
0
 public StatsCommand(Game game)
 {
     CommandName = "stats";
     this._game = game;
 }
Exemplo n.º 6
0
 public ChangeCommand(Game game)
 {
     CommandName = "change";
     this._game = game;
 }
Exemplo n.º 7
0
 public Loader(Game game)
 {
     this._game = game;
 }
Exemplo n.º 8
0
        static int Main()
        {
            Console.SetWindowSize(Console.LargestWindowWidth - 5, Console.LargestWindowHeight - 5);
            Console.ForegroundColor = ConsoleColor.Yellow;

            Game _game = new Game();

            _game.play();

            return 0;
        }
Exemplo n.º 9
0
 public DisplayCommand(Game game)
 {
     CommandName = "display";
         this._game = game;
 }
Exemplo n.º 10
0
 public GearCommand(Game game)
 {
     CommandName = "gear";
     this._game = game;
 }