示例#1
0
 public TextView(GameController controller)
 {
     Console.Title = "Welcome to Baricade \ntype \"help\" for help";
     Console.BufferWidth *= 2;
     this.controller = controller;
     show();
     Console.WriteLine("Welcome to Baricade \ntype \"help\" for help");
     while (!controller.Game.Finished)
     {
         if (controller.Game.CurrentPlayer.Human)
         {
             String line = Console.ReadLine().ToLower();
             line.Trim();
             String[] options = line.Split(' ');
             Console.Clear();
             commandline = line;
             show();
             check(options);
             Console.WriteLine();
             Console.WriteLine();
         }
         else
         {
             AIPlayer();
         }
     }
     show();
     Console.WriteLine("Player " + controller.Game.FinishSquare.Piece.Player.Color+" has won the Game");
     if(!controller.Game.FinishSquare.Piece.Player.Human)
     {
         Console.WriteLine("THE MACHINE ALWAYS WINS!!   MUHAHAHAHAHAAaa");
     }
     Console.ReadLine();
 }
示例#2
0
        public MainWindow(GameController controller)
        {
            this.controller = controller;
            this.board = controller.Game.Board;

            InitializeComponent();

            if (board.View.Style == null)
            {
                board.View.Style = "Minimalistic";
            }
            path = "pack://application:,,,/Style/" + board.View.Style + "/";

            setupGrid();
            fillGrid();
            GameController.Game.throwDice();
            if(controller.Game.CurrentPlayer.Baricade!=null)
            {
                selectedPiece = controller.Game.CurrentPlayer.Baricade;
            }
            lblThrow.Content = GameController.Game.CurrentDiceRoll;
            changeColor(GameController.Game.CurrentPlayer.Color);
        }