Example #1
0
 /// <summary>
 ///		Inicializa las etiquetas
 /// </summary>
 private void InitLabels()
 {
     for (int row = 0; row < 8; row++)
     {
         Scapes.Add(new LabelViewModel(row, -1, (char)('0' + 8 - row)));
     }
     for (int column = 0; column < 8; column++)
     {
         Scapes.Add(new LabelViewModel(-1, column, (char)('A' + column)));
     }
 }
Example #2
0
        /// <summary>
        ///		Inicializa las piezas
        /// </summary>
        private void InitPieces()
        {
            for (int row = 0; row < 8; row++)
            {
                for (int column = 0; column < 8; column++)
                {
                    PieceBaseModel piece = ViewModel.Board[row, column];

                    if (piece != null)
                    {
                        Scapes.Add(new FigureViewModel(row, column, piece.Type, piece.Color));
                    }
                }
            }
        }
Example #3
0
        /// <summary>
        ///		Inicaliza las celdas
        /// </summary>
        private void InitCells()
        {
            PieceBaseModel.PieceColor color = PieceBaseModel.PieceColor.White;

            // AƱade las celdas
            for (int row = 0; row < 8; row++)
            {
                // Rellena por columnas
                for (int column = 0; column < 8; column++)
                {
                    Scapes.Add(new CellViewModel(row, column, color));
                    color = GetNextColor(color);
                }
                // Cambia el color de inicio de la siguiente fila
                color = GetNextColor(color);
            }
        }