Start() public method

public Start ( ) : void
return void
Exemplo n.º 1
0
        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();
            }
        }
Exemplo n.º 2
0
    public void RestartButton()
    {
        SoundManager.Instance.MenuButtonSound();

        Owner[] owners = FindObjectsOfType <Owner>();

        foreach (Owner tile in owners)
        {
            tile.resetBoard();
            tile.resetMary();
            tile.resetEnemy();
            tile.locked = 0;
        }

        gameControl.marysHealth = gameControl.marysMaxHealth;
        gameControl.enemyHealth = gameControl.enemyMaxHealth;
        gameControl.UpdateBloodPoints();
        gameControl.playerStaffCooldown = 0;
        gameControl.enemyStaffCooldown  = 0;
        gameControl.GameOver();

        gameControl.Start();
        gameControl.gameOver.SetActive(false);
        gameControl.pauseMode = false;
        lossScreen.SetActive(false);

        SceneManager.LoadScene("GameBoard");
    }
Exemplo n.º 3
0
 void HumanVsRandomPlayer()
 {
     WholeBoard = new PentagoBoard();
     base.RaisePropertyChanged("WholeBoard");
     Control                    = new GameControl(this.WholeBoard, null, new RandomAIPlayer(WholeBoard));
     Control.GameOver           = new GameControl.GameOverHandler(GameOver);
     Control.RotatabilityChange = new GameControl.RotatabilityChangeHandler(RotateAction);
     Control.Start();
 }
Exemplo n.º 4
0
 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();
 }
Exemplo n.º 5
0
 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();
 }
Exemplo n.º 6
0
 private void Awake()
 {
     if (control == null)
     {
         control = this;
         stage   = 1;
         DontDestroyOnLoad(gameObject);
     }
     else if (control != this)
     {
         Destroy(gameObject);
         control.Start();
     }
 }
Exemplo n.º 7
0
        void HumanVsHuman()
        {
            WholeBoard = new PentagoBoard();

            //WholeBoard[1, 1].State = Status.StateEnum.black;
            //WholeBoard[1, 2].State = Status.StateEnum.black;
            //WholeBoard[1, 4].State = Status.StateEnum.black;

            //WholeBoard[4, 1].State = Status.StateEnum.white;
            //WholeBoard[4, 3].State = Status.StateEnum.white;
            //WholeBoard[4, 4].State = Status.StateEnum.white;

            base.RaisePropertyChanged("WholeBoard");
            Control = new GameControl(this.WholeBoard, null, null);
            //Control = new GameControl(this.WholeBoard, null, new AIPlayerCut(WholeBoard, 1));
            Control.GameOver           = new GameControl.GameOverHandler(GameOver);
            Control.RotatabilityChange = new GameControl.RotatabilityChangeHandler(RotateAction);
            Control.Start();
        }
Exemplo n.º 8
0
        public void Reset()
        {
            GameControl newGame = new GameControl();

            newGame.Start();
        }