void NextGame() { NextGameButtonVisibility = Visibility.Collapsed; GameMessage = ""; Title = "Diff " + Difficulty; WholeBoard = new PentagoBoard(); base.RaisePropertyChanged("WholeBoard"); var AI = AIFactory.NextAI(WholeBoard, Difficulty / 2); if (Difficulty % 2 == 1) { Control = new GameControl(WholeBoard, AI, null); Control.GameOver = postGameProcess; Control.RotatabilityChange = new GameControl.RotatabilityChangeHandler(RotateAction); Control.Start(); } else { Title += " - You go first"; Control = new GameControl(WholeBoard, null, AI); Control.GameOver = postGameProcess; Control.RotatabilityChange = new GameControl.RotatabilityChangeHandler(RotateAction); Control.Start(); } }
void ComputerVsHuman() { WholeBoard = new PentagoBoard(); base.RaisePropertyChanged("WholeBoard"); Control = new GameControl(this.WholeBoard, null, AIFactory.NextAI(WholeBoard, 2, false, 1)); Control.GameOver = new GameControl.GameOverHandler(GameOver); Control.RotatabilityChange = new GameControl.RotatabilityChangeHandler(RotateAction); Control.Start(); }
void ComputerVsComputer() { WholeBoard = new PentagoBoard(); //WholeBoard[1, 2].State = Status.StateEnum.black; //WholeBoard[1, 1].State = Status.StateEnum.black; //WholeBoard[1, 4].State = Status.StateEnum.black; //WholeBoard[4, 1].State = Status.StateEnum.white; //WholeBoard[4, 4].State = Status.StateEnum.white; base.RaisePropertyChanged("WholeBoard"); Control = new GameControl(this.WholeBoard, AIFactory.NextAI(WholeBoard, 2, false, 0), new AIPlayer(WholeBoard, 2)); Control.GameOver = new GameControl.GameOverHandler(GameOver); Control.RotatabilityChange = new GameControl.RotatabilityChangeHandler(RotateAction); Control.Start(); }
public AbstractPlayer Produce(PentagoBoard board, int level) { return(AIFactory.NextAI(board, level)); }