public TeamMatchData(string _teamId, TeamAttributes _attributes) { TeamId = _teamId; Statistics = new TeamStatistics(); Scorers = new List <PlayerData>(); YellowCards = new List <PlayerData>(); RedCards = new List <PlayerData>(); }
public static T GetTeamAttribute <T>(this Room room, int teamID, TeamAttributes teamAttribute, T defaultValue) { object attr; if (room.CustomProperties.TryGetValue("TEAM" + teamID + "/" + teamAttribute.ToString(), out attr)) { return((T)attr); } return(defaultValue); }
public MatchData(TeamData _home, TeamData _away, int _round, int _day, string _tournamentName, string _tournamentId) { TeamAttributes attributes = _home.IsPlaceholder ? _home.Attributes : null; HomeTeam = new TeamMatchData(_home.Id, attributes); attributes = _away.IsPlaceholder ? _away.Attributes : null; AwayTeam = new TeamMatchData(_away.Id, attributes); isPlayed = false; Round = _round; Day = _day; TournamentName = _tournamentName; TournamentId = _tournamentId; }
private IEnumerator LoadTeams() { mainController.AllTeams = new List <TeamData>(); string[] files = Directory.GetFiles(CombinePaths(userFolder, "Teams")); totalTeams = files.Length; foreach (string file in files) { TeamAttributes data = LoadFile <TeamAttributes>(file); TeamData team = ScriptableObject.CreateInstance <TeamData>(); team.Attributes = data; team.Initialize(true); if (team.IsUserControlled) { mainController.UserTeam = team; } mainController.AllTeams.Add(team); teamsLoaded++; } yield return(null); }
public static void SetTeamAttribute(this Room room, int teamID, TeamAttributes teamAttribute, object value) { Hashtable newTable = new Hashtable(); newTable["TEAM" + teamID + "/" + teamAttribute.ToString()] = value; room.SetCustomProperties(newTable); }