public FormationTeamInfo GetFormationTeam(FormationTeamType type) { if (_formationTeamDictionary.ContainsKey(type)) { return(_formationTeamDictionary[type]); } _formationTeamDictionary[type] = new FormationTeamInfo(type, 0, new SortedDictionary <FormationPosition, uint>()); return(_formationTeamDictionary[type]); }
public void AddTeamData(TeamProtoData data) { SortedDictionary <FormationPosition, uint> teamDic = new SortedDictionary <FormationPosition, uint>(); for (int j = 0, count2 = data.posList.Count; j < count2; j++) { teamDic.Add((FormationPosition)data.posList[j].posIndex, (uint)data.posList[j].heroId); } FormationTeamInfo info = new FormationTeamInfo((FormationTeamType)data.teamNo, data.lineupNo, teamDic); _formationTeamDictionary[(FormationTeamType)data.teamNo] = info; }
public void AddTeamData(FormationTeamType type, LuaTable data) { SortedDictionary <FormationPosition, uint> teamDic = new SortedDictionary <FormationPosition, uint>(); LuaTable teamPosTable = (LuaTable)data["teamPosTable"]; foreach (DictionaryEntry value in teamPosTable.ToDictTable()) { teamDic.Add((FormationPosition)value.Key.ToString().ToInt32(), (uint)value.Value.ToString().ToInt32()); } FormationTeamInfo info = new FormationTeamInfo(type, data["formationId"].ToString().ToInt32(), teamDic); _formationTeamDictionary[type] = info; }