Example #1
0
    public void GetTeamsSolutionsOnMatchResult(string result)
    {
        //print("Teams: ");
        //print(result);

        if (result[0] == '[')
        {
            result = DeleteIncorrectSymbols(result);
        }

        TeamInfo Team1 = null;
        TeamInfo Team2 = null;

        TeamInfo.CreateTeams(result, out Team1, out Team2, "\n");

        //print("Team1 - " + Team1.TeamName);
        //print("mainPlayers:");
        //foreach (PlayerInfo item in Team1.mainPlayers)
        //{
        //    print(item.TeamName + " | " + item.PlayerName);
        //}
        //print("substitutePlayers:");
        //foreach (PlayerInfo item in Team1.substitutePlayers)
        //{
        //    print(item.TeamName + " | " + item.PlayerName);
        //}
        //print("-----------------------------");


        //print("Team2 - " + Team2.TeamName);
        //print("mainPlayers:");
        //foreach (PlayerInfo item in Team2.mainPlayers)
        //{
        //    print(item.TeamName + " | " + item.PlayerName);
        //}
        //print("substitutePlayers:");
        //foreach (PlayerInfo item in Team2.substitutePlayers)
        //{
        //    print(item.TeamName + " | " + item.PlayerName);
        //}
        //print("-----------------------------");


        if (OnTeam1Changed != null)
        {
            OnTeam1Changed.Invoke(Team1);
        }

        if (OnTeam2Changed != null)
        {
            OnTeam2Changed.Invoke(Team2);
        }

        //PlayerInfo[] playerInfos = JsonHelper.FromJson<PlayerInfo>(result);

        //print("playerInfos.Length: " + playerInfos.Length);
    }