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; }
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); }
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; }