예제 #1
0
        public GameBoardWPF(int gameId, GameMove[] moves, bool confirmation)
        {
            InitializeComponent();
            c = new ServiceClient(new InstanceContext(this));
            this.gameId = gameId;
            this.moves = moves;
            this.confirmation = confirmation;
            boardSize = c.GetSizeGame(gameId);

            buttons1 = CreateButtons();

            initGrid();

            for (int i = 0; i < boardSize; i++)
            {
                for(int j = 0; j < boardSize; j++)
                {
                    buttons1[i, j].IsEnabled = false;
                }
            }

            // print all moves on game board
            for (int i = 0; i < moves.Count(); i++)
            {
                int row = Convert.ToInt32(moves[i].row);
                int col = Convert.ToInt32(moves[i].col);
                string s = moves[i].Sign;
                buttons1[row, col].Content = s;
                buttons1[row, col].FontSize = 50;
                buttons1[row, col].IsEnabled = false;
            }
        }