예제 #1
0
    public Transform FetchOtherPlayer(GameObject currentPlayer)
    {
        GamePhaseBehavior_Play playBehavior = (GamePhaseBehavior_Play)gamePhaseDictionary[GamePhaseTypes.play];
        List <GameObject>      playerList   = new List <GameObject>(playBehavior.GetPlayers());

        playerList.Remove(currentPlayer);
        if (playerList.Count > 0)
        {
            return(playerList[Random.Range(0, playerList.Count)].transform);
        }
        else
        {
            return(null);
        }
    }
예제 #2
0
    public string FetchResults()
    {
        string results = "";
        GamePhaseBehavior_Play playBehavior = (GamePhaseBehavior_Play)gamePhaseDictionary[GamePhaseTypes.play];
        List <GameObject>      playerList   = new List <GameObject>(playBehavior.GetPlayers());

        if (playerList.Count > 0)
        {
            if (playerList.Count > 1)
            {
                results = "DRAW!";
            }
            else
            {
                results = playerList[0].name.ToUpper() + " WINS!";
            }
        }
        return(results);
    }