private void CopyCellStates(IEnumerable <HexCellViewModel> otherCells) { foreach (HexCellViewModel originalCell in otherCells) { HexCellViewModel newCell = this.GetCellAtLocation(originalCell.Location); newCell.Occupied = originalCell.Occupied; } }
private void MoveCompleted(ComputerMoveData computerMoveData) { HexCellViewModel cellToPlay = this.currentViewModel.GetCellAtLocation(computerMoveData.Move); if (cellToPlay != null) { cellToPlay.PlayCell(); this.currentViewModel.SetLastMoveDuration(computerMoveData.Time); } }
public void Populate() { for (int x = 0; x < this.BoardSize; x++) { for (int y = 0; y < this.BoardSize; y++) { HexCellViewModel hexCell = new HexCellViewModel(this) { BoardX = x, BoardY = y }; this.Cells.Add(hexCell); } } }
private static void ShowBestMoveCompleted(ComputerMoveData bestMoveData, HexBoardViewModel boardViewModel, int moveSkillLevel) { HexCellViewModel bestMoveCell = boardViewModel.Cells.FirstOrDefault(cell => cell.Location == bestMoveData.Move); if (bestMoveCell != null) { HexCellDebugDataViewModel debugData = bestMoveCell.DebugData; if (bestMoveData.PlayerX) { debugData.IsMoveForPlayerX = Visibility.Visible; debugData.MoveForPlayerXText = AddSkillText(debugData.MoveForPlayerXText, moveSkillLevel); } else { debugData.IsMoveForPlayerY = Visibility.Visible; debugData.MoveForPlayerYText = AddSkillText(debugData.MoveForPlayerYText, moveSkillLevel); } } }