Esempio n. 1
0
 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]);
 }
Esempio n. 2
0
        public bool IsTeamUnlocked(int teamIndex)
        {
            FormationTeamType type = (FormationTeamType)(teamIndex - 1 + (int)FormationTeamType.pveFirstTeam);

            if (!formationTeamDictionary.ContainsKey(type))
            {
                return(false);
            }
            FormationTeamInfo info = formationTeamDictionary[type];

            return(info.teamPosDictionary.Count != 0);
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
 public FormationTeamInfo(FormationTeamType type, int formationId, SortedDictionary <FormationPosition, uint> teamPosDictionary)
 {
     this.formationId       = formationId;
     this.type              = type;
     this.teamPosDictionary = teamPosDictionary;
 }