Exemplo n.º 1
0
 public void CheckPropGroups()
 {
     if (ISCGroups == null)
     {
         InitISCGroups(ISC);
     }
     foreach (var prop in Properties.Values)
     {
         Dictionary <string, int> stats = prop.Stats;
         List <int> groups = new List <int>();
         foreach (var stat in stats.Keys)
         {
             if (ISCGroups.ContainsKey(stat))
             {
                 groups.Add(ISCGroups[stat].DescGroup.GetValueOrDefault());
             }
         }
         if (groups.Count > 0)
         {
             foreach (var group in groups)
             {
                 CheckPropGroup(prop, group);
             }
         }
     }
 }
Exemplo n.º 2
0
        private void CheckPropGroup(Properties prop, int group)
        {
            var  fullGroup   = ISCGroups.Where(x => x.Value.DescGroup == group).ToList();
            var  tempStats   = prop.Stats;
            bool isFullGroup = false;

            for (int i = 0; i < fullGroup.Count; i++)
            {
                if (!tempStats.ContainsKey(fullGroup[i].Key))
                {
                    return;
                }
                else
                {
                    if (i == fullGroup.Count - 1)
                    {
                        isFullGroup = true;
                    }
                }
            }
            if (isFullGroup)
            {
                prop.Stats = tempStats;
                for (int i = 0; i < fullGroup.Count; i++)
                {
                    if (i == 0)
                    {
                        tempStats[fullGroup[i].Key] = 2;
                    }
                    else
                    {
                        tempStats[fullGroup[i].Key] = 1;
                    }
                }
            }
            return;
        }