コード例 #1
0
 private void CopyCellStates(IEnumerable <HexCellViewModel> otherCells)
 {
     foreach (HexCellViewModel originalCell in otherCells)
     {
         HexCellViewModel newCell = this.GetCellAtLocation(originalCell.Location);
         newCell.Occupied = originalCell.Occupied;
     }
 }
コード例 #2
0
        private void MoveCompleted(ComputerMoveData computerMoveData)
        {
            HexCellViewModel cellToPlay = this.currentViewModel.GetCellAtLocation(computerMoveData.Move);

            if (cellToPlay != null)
            {
                cellToPlay.PlayCell();
                this.currentViewModel.SetLastMoveDuration(computerMoveData.Time);
            }
        }
コード例 #3
0
        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);
                }
            }
        }
コード例 #4
0
        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);
                }
            }
        }
コード例 #5
0
        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);
                }
            }
        }