Пример #1
0
        public void SynchronizeLegionSquadronToPlayerData(int index, int order)
        {
            Dictionary <int, Legion.Model> legions = legionDB.legions;
            int id = index;

            Legion.Data legion;
            if (playerData.legions.ContainsKey(id))
            {
                legion = playerData.legions[id];
                legion.squadron.Remove(order);
            }
            else
            {
                legion = new Legion.Data(id);
                playerData.legions.Add(index, legion);
            }
            int type = (int)legions[id].m_squadron[order].type;

            Unit.Data unit = new Unit.Data();
            unit.Type = type;
            unit.HP   = legions[id].m_squadron[order].HP;
            // unit.Level = legions[id].m_squadron[order].HP;
            // unit.Exp = legions[id].m_squadron[order].HP;
            legion.squadron.Add(order, unit);
        }
Пример #2
0
        public void SynchronizeLegionToPlayerData(int index)
        {
            Dictionary <int, Legion.Model> legions = legionDB.legions;
            int id = index;

            Legion.Data legion = new Legion.Data(id);
            if (playerData.legions.ContainsKey(id))
            {
                playerData.legions[id] = legion;
            }
            else
            {
                playerData.legions.Add(id, legion);
            }

            for (int order = 0; order < legions[id].m_squadron.Length; order++)
            {
                int type = (int)legions[id].m_squadron[order].type;
                if (type == 0)
                {
                    continue;
                }
                Unit.Data unit = new Unit.Data();
                unit.Type = type;
                unit.HP   = legions[id].m_squadron[order].HP;
                // unit.Level = legions[id].m_squadron[order].HP;
                // unit.Exp = legions[id].m_squadron[order].HP;
                legion.squadron.Add(order, unit);
            }
        }
Пример #3
0
        public void SynchronizeUnitsToPlayerData()
        {
            playerData.units.Clear();
            Dictionary <int, Legion.Model> legions = legionDB.legions;
            List <int> keys      = legions.Keys.ToList();
            int        dataCount = keys.Count;

            for (int index = 0; index < dataCount; index++)
            {
                int id = keys[index];
                if (id < 9900)
                {
                    continue;
                }

                for (int order = 0; order < legions[id].m_squadron.Length; order++)
                {
                    int type = (int)legions[id].m_squadron[order].type;
                    if (type == 0)
                    {
                        continue;
                    }
                    Unit.Data unit = new Unit.Data();
                    unit.Type = type;
                    unit.HP   = legions[id].m_squadron[order].HP;
                    // unit.Level = legions[id].m_squadron[order].HP;
                    // unit.Exp = legions[id].m_squadron[order].HP;
                    playerData.units.Add(unit);
                }
            }
        }
Пример #4
0
        public void SynchronizeLegionsToPlayerData()
        {
            playerData.legions.Clear();
            Dictionary <int, Legion.Model> legions = legionDB.legions;
            List <int> keys      = legions.Keys.ToList();
            int        dataCount = keys.Count;

            for (int index = 0; index < dataCount; index++)
            {
                int         id     = keys[index];
                Legion.Data legion = new Legion.Data(id);
                if (playerData.legions.ContainsKey(id))
                {
                    playerData.legions[id] = legion;
                }
                else
                {
                    playerData.legions.Add(id, legion);
                }

                for (int order = 0; order < legions[id].m_squadron.Length; order++)
                {
                    int type = (int)legions[id].m_squadron[order].type;
                    if (type == 0)
                    {
                        continue;
                    }
                    Unit.Data unit = new Unit.Data();
                    unit.Type = type;
                    unit.HP   = legions[id].m_squadron[order].HP;
                    // unit.Level = legions[id].m_squadron[order].HP;
                    // unit.Exp = legions[id].m_squadron[order].HP;
                    legion.squadron.Add(order, unit);
                }
            }
        }