Пример #1
0
        public void ParseBonus(string _datas)
        {
            var num = 1;

            if (_datas == "")
                return;

            foreach (var infos in _datas.Split(';'))
            {
                if (infos == "")
                    continue;

                lock(BonusList)
                    BonusList.Add(++num, new List<Game.Effects.EffectItem>());

                foreach (var datas in infos.Split(','))
                {
                    if (datas == "")
                        continue;

                    var bonus = new Game.Effects.EffectItem();
                    bonus.ID = int.Parse(datas.Split(':')[0]);
                    bonus.Value = int.Parse(datas.Split(':')[1]);

                    lock(BonusList[num])
                        BonusList[num].Add(bonus);
                }
            }
        }
Пример #2
0
        public void ParseRandomJet()
        {
            if (EffectsList.Count != 0)
                return;

            var jet = Jet;

            foreach (var _jet in jet.Split(','))
            {
                if (_jet == "") continue;
                var infos = _jet.Split('#');

                var myEffect = new Game.Effects.EffectItem();
                myEffect.ID = Utilities.Basic.HexToDeci(infos[0]);

                if (infos.Length > 1) myEffect.Value = Utilities.Basic.HexToDeci(infos[1]);
                if (infos.Length > 2) myEffect.Value2 = Utilities.Basic.HexToDeci(infos[2]);
                if (infos.Length > 3) myEffect.Value3 = Utilities.Basic.HexToDeci(infos[3]);
                if (infos.Length > 4) myEffect.Effect = infos[4];

                lock(EffectsList)
                    EffectsList.Add(myEffect);
            }
        }