Exemple #1
0
    public void ChangeTurn()
    {
        turn = !turn;
        if (turn != playerTurn)
        {
            OthelloHUDManager.Prompt(GetCurrentTurnText + "AI's turn!");
            EventManager.instance.FreezeControl();
            AIPlay();
        }
        else
        {
            OthelloHUDManager.Prompt(GetCurrentTurnText + "Player's turn!");
            EventManager.instance.GrantControl();
        }
        foreach (OthelloZoneBehaviour z in possibleZones)
        {
            if (PutPieceCheck(z, turn))
            {
                return;
            }
        }

        if (skipped)
        {
            Debug.Log("Ended?");
            EndGame();
        }
        else
        {
            skipped = true;
            OthelloHUDManager.Prompt("No valid move for " + GetCurrentTurnText + "player, turn skipped!");
            ChangeTurn();
        }
    }
Exemple #2
0
 public void OnTap()
 {
     if (!OthelloGameManager.Instance.PutPieceCheck(this, OthelloGameManager.Instance.GetCurrentTurn))
     {
         Debug.Log("illegal"); OthelloHUDManager.Prompt("Illegal Move!"); return;
     }
     OthelloGameManager.Instance.PutPiece(this, OthelloGameManager.Instance.GetCurrentTurn);
 }