Ejemplo n.º 1
0
 public Cell(CellPosition position, CellColor color, Checker checker, Desk desk)
 {
     _position              = position;
     _color                 = color;
     Checker                = checker;
     ActiveButtonColor      = Brushes.Gray;
     ActiveCheckerColor     = Brushes.Gold;
     ActiveKingCheckerColor = Brushes.Cyan;
     AllowedPositionColor   = Brushes.LawnGreen;
     _desk = desk;
 }
Ejemplo n.º 2
0
        private Cell ConstructCell(int row, int column, bool withCheckers)
        {
            var cellColor    = new CellColor(((column + row) % 2) == 0);
            var cellPosition = new CellPosition(column, row);
            var deskCell     = new Cell(cellPosition, cellColor, null, this);

            _selectedCell = null;
            if (withCheckers)
            {
                deskCell.SetDefaultChecker(this);
            }
            return(deskCell);
        }
Ejemplo n.º 3
0
        public Cell(CellPosition position, string rawCell, Desk desk)
        {
            Checker checker;
            var     rawChrcker = int.Parse(rawCell.Substring(1, 1));

            switch (rawChrcker)
            {
            case 1:
                checker = new Checker(false, false);
                break;

            case 2:
                checker = new Checker(false, true);
                break;

            case 3:
                checker = new Checker(true, false);
                break;

            case 4:
                checker = new Checker(true, true);
                break;

            default:
                checker = null;
                break;
            }

            _position              = position;
            _color                 = new CellColor(rawCell[0] == '1');
            Checker                = checker;
            ActiveButtonColor      = Brushes.Gray;
            ActiveCheckerColor     = Brushes.Gold;
            ActiveKingCheckerColor = Brushes.Cyan;
            AllowedPositionColor   = Brushes.LawnGreen;
            _desk = desk;
        }