Example #1
0
        /// <summary>
        /// Returns item in code string.
        /// </summary>
        /// <returns></returns>
        public string ToCode()
        {
            StringBuilder ret = new StringBuilder();

            ret.Append("R" + Runway + "/");
            if (DeviceMeasurementRestriction != null)
            {
                ret.Append(DeviceMeasurementRestriction.Value.ToString());
            }
            ret.Append(Distance.ToString("0000"));
            if (VariableDistance.HasValue)
            {
                ret.Append("V" + VariableDistance.Value.ToString("0000"));
            }
            if (Unit == Common.eDistanceUnit.ft)
            {
                ret.Append("FT");
            }
            else if (Tendency.HasValue)
            {
                ret.Append(Tendency.ToString());
            }

            return(ret.ToString());
        }
Example #2
0
        /// <summary>
        /// 开奖趋势分析
        /// </summary>
        private void analyzeTendency(Lottery lottery, Tendency tendency, int index1, int index2)
        {
            tendency.ClearTendencys();//清空记录
            TendencyModel tm;

            AnalyzeTendency at = new AnalyzeTendency();

            for (int i = lottery.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm          = new TendencyModel();
                tm.ID       = i + 1;
                tm.Lottery  = lottery.Lt_Lotterys[i].Lottery;
                tm.Big      = at.BigNum(lottery.Lt_Lotterys, i, index1, index2);          //大大
                tm.BigSmall = at.BigSmallNum(lottery.Lt_Lotterys, i, index1, index2);     //大小
                tm.SmallBig = at.SmallBigNum(lottery.Lt_Lotterys, i, index1, index2);     //小大
                tm.Small    = at.SmallNum(lottery.Lt_Lotterys, i, index1, index2);        //小小

                tm.Odd     = at.OddPairNum(lottery.Lt_Lotterys, i, index1, index2, 1, 1); //奇奇
                tm.OddPair = at.OddPairNum(lottery.Lt_Lotterys, i, index1, index2, 1, 0); //奇偶
                tm.PairOdd = at.OddPairNum(lottery.Lt_Lotterys, i, index1, index2, 0, 1); //偶奇
                tm.Pair    = at.OddPairNum(lottery.Lt_Lotterys, i, index1, index2, 0, 0); //偶偶
                tm.Dbl     = at.DblNum(lottery.Lt_Lotterys, i, index1, index2);           //重数

                tm.SNO   = (lottery.Lt_Lotterys[i].Sno.ToString() + "期").PadLeft(5, '0');
                tm.Dtime = lottery.Lt_Lotterys[i].Dtime;

                tendency.AddTendency(tm);//添加趋势记录
            }
        }
Example #3
0
        /// <summary>
        /// 前二、后二开奖趋势分析
        /// </summary>
        private void analyzeTendency()
        {
            Tendency.ClearTendencys();//清空记录
            TendencyModel tm;

            AnalyzeTendency at = new AnalyzeTendency();

            for (int i = Lottery.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm          = new TendencyModel();
                tm.Big      = at.BigNum(i, EnumStyle);          //大大
                tm.BigSmall = at.BigSmallNum(i, EnumStyle);     //大小
                tm.SmallBig = at.SmallBigNum(i, EnumStyle);     //小大
                tm.Small    = at.SmallNum(i, EnumStyle);        //小小

                tm.Odd     = at.OddPairNum(i, 1, 1, EnumStyle); //奇奇
                tm.OddPair = at.OddPairNum(i, 1, 0, EnumStyle); //奇偶
                tm.PairOdd = at.OddPairNum(i, 0, 1, EnumStyle); //偶奇
                tm.Pair    = at.OddPairNum(i, 0, 0, EnumStyle); //偶偶
                tm.Dbl     = at.DblNum(i, EnumStyle);           //重数
                Tendency.AddTendency(tm);                       //添加趋势记录
            }

            for (int i = 0, j = Lottery.Lt_Lotterys.Count - 1; i < Lottery.Lt_Lotterys.Count; i++)
            {
                Lottery.Lt_Lotterys[i].sno = j;
                j--;
            }
        }
Example #4
0
        /// <summary>
        /// 前二、后二开奖趋势分析
        /// </summary>
        private void analyzeTendency()
        {
            Tendency.ClearTendencys();//清空记录
            TendencyModel tm;

            AnalyzeTendency at = new AnalyzeTendency();

            for (int i = Lottery.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm          = new TendencyModel();
                tm.ID       = i + 1;
                tm.Big      = at.BigNum(i, xscpStyle.num1, xscpStyle.num2);          //大大
                tm.BigSmall = at.BigSmallNum(i, xscpStyle.num1, xscpStyle.num2);     //大小
                tm.SmallBig = at.SmallBigNum(i, xscpStyle.num1, xscpStyle.num2);     //小大
                tm.Small    = at.SmallNum(i, xscpStyle.num1, xscpStyle.num2);        //小小

                tm.Odd     = at.OddPairNum(i, xscpStyle.num1, xscpStyle.num2, 1, 1); //奇奇
                tm.OddPair = at.OddPairNum(i, xscpStyle.num1, xscpStyle.num2, 1, 0); //奇偶
                tm.PairOdd = at.OddPairNum(i, xscpStyle.num1, xscpStyle.num2, 0, 1); //偶奇
                tm.Pair    = at.OddPairNum(i, xscpStyle.num1, xscpStyle.num2, 0, 0); //偶偶
                tm.Dbl     = at.DblNum(i, xscpStyle.num1, xscpStyle.num2);           //重数

                tm.SNO = (Lottery.Lt_Lotterys[i].sno.ToString() + "期").PadLeft(5, '0');
                tm.Dt  = getDate(Lottery.Lt_Lotterys[i].sno);

                Tendency.AddTendency(tm);//添加趋势记录
            }
        }
Example #5
0
    public God()
    {
        godType = EGodType.GOD_1;

        this.divineRank      = 0;
        this.divinePower     = 0;
        this.popularity      = 0;
        this.numberOfApostle = 0;
        this.tendency        = new Tendency();
    }
Example #6
0
        private void analyze5Tendency(Lottery lottery, Tendency <Tendency5Model> tendency)
        {
            tendency.ClearTendencys();//清空记录
            Tendency5Model tm;

            for (int i = lottery.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm           = new Tendency5Model();
                tm.FiveStart = At.FiveStart(lottery.Lt_Lotterys, i);
                tm.Sno       = (lottery.Lt_Lotterys[i].Sno.ToString() + "期").PadLeft(5, '0');
                tm.Dtime     = lottery.Lt_Lotterys[i].Dtime;
                tendency.AddTendency(tm);//添加趋势记录
            }
        }
Example #7
0
        private void analyze3Tendency(Lottery lottery, Tendency <Tendency3Model> tendency, int index1, int index2, int index3)
        {
            tendency.ClearTendencys();//清空记录
            Tendency3Model tm;

            for (int i = lottery.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm           = new Tendency3Model();
                tm.UnitThree = At.UnitThree(lottery.Lt_Lotterys, i, index1, index2, index3);
                tm.Sno       = (lottery.Lt_Lotterys[i].Sno.ToString() + "期").PadLeft(5, '0');
                tm.Dtime     = lottery.Lt_Lotterys[i].Dtime;
                tendency.AddTendency(tm);//添加趋势记录
            }
        }
Example #8
0
        static Tendency[] GetTendencies(Catalog.Models.GroupDetail gd)
        {
            var tendencies = new Tendency[gd.Tick.Length];

            for (int i = 0; i < gd.Tick.Length; i++)
            {
                tendencies[i] = new Tendency
                {
                    Code        = gd.Code,
                    Tick        = gd.Tick[i],
                    Inclination = double.IsNaN(gd.Inclination[i]) ? 0 : gd.Inclination[i]
                }
            }
            ;
            return(tendencies);
        }
Example #9
0
        private void analyzeAllTendency(Lottery lottery, Tendency <TendencyAllModel> tendency)
        {
            tendency.ClearTendencys();//清空记录
            TendencyAllModel tm;

            for (int i = lottery.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm = new TendencyAllModel();
                tm.ThreeBeforeStart = At.UnitThree(lottery.Lt_Lotterys, i, 1, 2, 3);
                tm.ThreeAfterStart  = At.UnitThree(lottery.Lt_Lotterys, i, 3, 4, 5);
                tm.FiveStart        = At.FiveStart(lottery.Lt_Lotterys, i);
                tm.Sno   = (lottery.Lt_Lotterys[i].Sno.ToString() + "期").PadLeft(5, '0');
                tm.Dtime = lottery.Lt_Lotterys[i].Dtime;
                tendency.AddTendency(tm);//添加趋势记录
            }
        }
Example #10
0
        private void initDgv3(Tendency tendency)
        {
            object objBigSmall = null;
            object objOddPair  = null;

            DgvController.AddRows(this.dgv3, 4);
            if (tendency.Lt_Tendencys.Count > 0)
            {
                for (int i = 0; i < UnitTendency.Lt_BigSmallUnits.Count; i++)
                {
                    this.dgv3[0, i].Value = UnitTendency.Lt_BigSmallUnits[i].ChName;
                    for (int j = 0; j < UnitTendency.Lt_OddPairUnits.Count; j++)
                    {
                        objBigSmall = Common.Reflection.GetPropertyValue(typeof(TendencyModel), tendency.CurrTendency, UnitTendency.Lt_BigSmallUnits[i].EnName);
                        objOddPair  = Common.Reflection.GetPropertyValue(typeof(TendencyModel), tendency.CurrTendency, UnitTendency.Lt_OddPairUnits[j].EnName);
                        object[] param = { objBigSmall, objOddPair };
                        this.dgv3[j + 1, i].Value = string.Format(getUinitInfo(i, j), param);//写值
                    }
                }

                for (int i = 0; i < this.dgv3.Rows.Count; i++)
                {
                    for (int j = 1; j < this.dgv3.Columns.Count; j++)
                    {
                        if ((i == 1 || i == 2) && (j == 2 || j == 3))
                        {
                            continue;
                        }
                        DgvController.SetDgvBackColorStyle(this.dgv3, i, j, Color.LightSteelBlue, 11);//设置单元格的格式
                    }
                }

                string zero = "【0,0】";
                for (int i = 0; i < this.dgv3.Rows.Count; i++)
                {
                    for (int j = 1; j < this.dgv3.Columns.Count; j++)
                    {
                        if (this.dgv3[j, i].Value.ToString().Contains(zero))
                        {
                            DgvController.SetDgvBackColorStyle(this.dgv3, i, j, Color.Green, 12);//设置单元格的格式
                        }
                    }
                }
            }
        }
Example #11
0
    public Organization()
    {
        this.baseTendency    = new Tendency();
        this.personPerJobDic = new Dictionary <EPersonJobType, List <Person> >();
        this.numberOfMembers = 0;


        int numberOfPersonJob = Person.NumberOfPersonJobType;

        for (int i = 0; i < numberOfPersonJob; i++)
        {
            List <Person>  personList = new List <Person>();
            EPersonJobType jobType    = (EPersonJobType)i;
            personPerJobDic.Add(jobType, personList);
        }

        OnPeopleChanged += Organization_OnPeopleChanged;
    }
Example #12
0
        /// <summary>
        /// 获取最大走势值
        /// </summary>
        /// <returns></returns>
        private Tendency2Model GetMaxTendency(Tendency <Tendency2Model> tendency)
        {
            if (tendency.Lt_Tendencys.Count <= 0)
            {
                return(new Tendency2Model());
            }
            Tendency2Model tm = new Tendency2Model();

            tm.Big      = tendency.Lt_Tendencys.Max(l => l.Big);      //大
            tm.Small    = tendency.Lt_Tendencys.Max(l => l.Small);    //小
            tm.BigSmall = tendency.Lt_Tendencys.Max(l => l.BigSmall); //大小
            tm.SmallBig = tendency.Lt_Tendencys.Max(l => l.SmallBig); //小大

            tm.Odd     = tendency.Lt_Tendencys.Max(l => l.Odd);       //奇
            tm.Pair    = tendency.Lt_Tendencys.Max(l => l.Pair);      //偶
            tm.OddPair = tendency.Lt_Tendencys.Max(l => l.OddPair);   //奇偶
            tm.PairOdd = tendency.Lt_Tendencys.Max(l => l.PairOdd);   //偶奇
            tm.Dbl     = tendency.Lt_Tendencys.Max(l => l.Dbl);       //重
            return(tm);
        }
Example #13
0
        /// <summary>
        /// 分析定位胆:个十百千万
        /// </summary>
        private void analyzeDwdBitTendency(int index)
        {
            Tendency <Tendency1Model> tendency = (Tendency <Tendency1Model>)lt_dwds[index - 1];

            tendency.ClearTendencys();

            Tendency1Model tm;

            for (int i = lotteryFF.Lt_Lotterys.Count - 1; i >= 0; i--)
            {
                tm       = new Tendency1Model();
                tm.Big   = At.BigNum(lotteryFF.Lt_Lotterys, i, index);       //大
                tm.Small = At.SmallNum(lotteryFF.Lt_Lotterys, i, index);     //小

                tm.Odd  = At.OddPairNum(lotteryFF.Lt_Lotterys, i, index, 1); //奇
                tm.Pair = At.OddPairNum(lotteryFF.Lt_Lotterys, i, index, 0); //偶

                tm.Sno   = (lotteryFF.Lt_Lotterys[i].Sno.ToString() + "期").PadLeft(5, '0');
                tm.Dtime = lotteryFF.Lt_Lotterys[i].Dtime;
                tendency.AddTendency(tm);//添加趋势记录
            }
        }
Example #14
0
        private void btnFind_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;

            TimeSpan d = this.dtpEnd.Value - this.dtpStart.Value;

            days = d.Days + 1;
            string fileName = null;

            Lottery lottery = new LotteryFF();
            Tendency <Tendency2Model> tendency    = new Tendency <Tendency2Model>();
            Tendency2Model            maxTendency = null;

            maxTendencys.Clear();
            for (int i = 0; i < days; i++)
            {
                fileName = Param.FileBase + @"分分彩\" + "ffcp" + this.dtpStart.Value.AddDays(i).ToString("yyyyMMdd") + ".txt";
                if (!File.Exists(fileName))
                {
                    continue;
                }
                coreMethod.ReadFile(this.dtpStart.Value.AddDays(i), lottery, fileName);//读取文件
                coreMethod.AnalyzeTendency(lottery, tendency, num1, num2);
                maxTendency       = GetMaxTendency(tendency);
                maxTendency.Dtime = this.dtpStart.Value.AddDays(i).ToString("yyyyMMdd");
                maxTendency.Sno   = this.dtpStart.Value.AddDays(i).DayOfWeek.ToString();
                maxTendencys.Add(maxTendency);
            }

            maxTendency = GetMaxTendency(maxTendencys);

            if (maxTendencys.Count > 0)
            {
                initDgv1(maxTendencys, maxTendency);
            }
            this.Cursor = null;
        }
Example #15
0
        public static void CreateSuffixSeries(Level lvl, string name, Tendency tend, Enchant ench1, int factorStart1, int factorEnd1,
            Enchant ench2 = 0, int factorStart2 = 0, int factorEnd2 = 0,
            Enchant ench3 = 0, int factorStart3 = 0, int factorEnd3 = 0)
        {
            int progression1 = (factorEnd1 - factorStart1) / 10;
            int progression2 = (factorEnd2 - factorStart2) / 10;
            int progression3 = (factorEnd3 - factorStart3) / 10;

            int enchant1 = (int)ench1;
            int enchant2 = (int)ench2;
            int enchant3 = (int)ench3;

            int level = (int)lvl;
            int tendency = (int)tend;

            LegacyToolBox.AppendMessage(string.Format("creating suffix {0}+{1}+{2} of level {3} tendency {4}", enchant1, enchant2, enchant3, level, tendency));

            int maxid = (from d in LegacyToolBox.Data.ItemRandomSuffix select d.ID).Max() + 1;

            item_suffix suffixDb = new item_suffix();
            suffixDb.Level = level;
            suffixDb.Suffix = -maxid;
            suffixDb.Tendency = tendency;

            int p = 0;
            ItemRandomSuffix suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank1 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank2 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank3 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank4 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank5 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank6 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank7 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank8 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank9 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank10 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            DB.LEGACY.item_suffix.Add(suffixDb);
            DB.LSave();
        }
Example #16
0
        public static int GetRandomSocketBonus(Tendency tendency, int level)
        {
            List<int> list = new List<int>();
            switch (tendency)
            {
                case Tendency.ATTACK:
                    list.Add(GetSocketBonus(ItemStat.AGILITY, level));
                    list.Add(GetSocketBonus(ItemStat.STRENGTH, level));
                    list.Add(GetSocketBonus(ItemStat.HIT_MELEE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.CRIT_MELEE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.HASTE_MELEE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.EXPERTISE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.ATTACK_POWER, level));
                    list.Add(GetSocketBonus(ItemStat.ARMOR_PENETRATION_RATING, level));
                    break;

                case Tendency.CAST:
                    list.Add(GetSocketBonus(ItemStat.INTELLECT, level));
                    list.Add(GetSocketBonus(ItemStat.HIT_SPELL_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.HASTE_SPELL_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.CRIT_SPELL_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.SPELL_DAMAGE, level));
                    list.Add(GetSocketBonus(ItemStat.MANA_REGEN, level));
                    list.Add(GetSocketBonus(ItemStat.SPELL_PENETRATION, level));
                    break;

                case Tendency.HEAL:
                    list.Add(GetSocketBonus(ItemStat.SPIRIT, level));
                    list.Add(GetSocketBonus(ItemStat.HASTE_SPELL_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.CRIT_SPELL_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.SPELL_HEALING, level));
                    list.Add(GetSocketBonus(ItemStat.MANA_REGEN, level));
                    break;

                case Tendency.DEFEND:
                    list.Add(GetSocketBonus(ItemStat.DEFENSE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.DODGE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.PARRY_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.HEALTH_REGEN, level));
                    break;

                case Tendency.SHIELD:
                    list.Add(GetSocketBonus(ItemStat.BLOCK_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.BLOCK_VALUE, level));
                    break;

                case Tendency.NONE:
                    list.Add(GetSocketBonus(ItemStat.AGILITY, level));
                    list.Add(GetSocketBonus(ItemStat.STRENGTH, level));
                    list.Add(GetSocketBonus(ItemStat.HIT_MELEE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.CRIT_MELEE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.HASTE_MELEE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.EXPERTISE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.ATTACK_POWER, level));
                    list.Add(GetSocketBonus(ItemStat.ARMOR_PENETRATION_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.INTELLECT, level));
                    list.Add(GetSocketBonus(ItemStat.HIT_SPELL_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.HASTE_SPELL_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.CRIT_SPELL_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.SPELL_DAMAGE, level));
                    list.Add(GetSocketBonus(ItemStat.MANA_REGEN, level));
                    list.Add(GetSocketBonus(ItemStat.SPELL_PENETRATION, level));
                    list.Add(GetSocketBonus(ItemStat.SPIRIT, level));
                    list.Add(GetSocketBonus(ItemStat.SPELL_HEALING, level));
                    list.Add(GetSocketBonus(ItemStat.DEFENSE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.DODGE_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.PARRY_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.HEALTH_REGEN, level));
                    list.Add(GetSocketBonus(ItemStat.BLOCK_RATING, level));
                    list.Add(GetSocketBonus(ItemStat.BLOCK_VALUE, level));
                    break;

                default:
                    return 0;
            }

            list.Add(GetSocketBonus(ItemStat.STAMINA, level));
            return list[rand.Next(0, list.Count)];
        }
Example #17
0
        public override Dictionary <string, object> Parse(string remainingMetar, bool withCavok = false)
        {
            var consumed          = Consume(remainingMetar);
            var found             = consumed.Value;
            var newRemainingMetar = consumed.Key;
            var result            = new Dictionary <string, object>();

            if (found.Count > 1)
            {
                var runways = new List <RunwayVisualRange>();
                // iterate on the results to get all runways visual range found
                for (int i = 1; i <= 20; i += 7)
                {
                    if (!string.IsNullOrEmpty(found[i].Value))
                    {
                        // check runway qfu validity
                        var qfuAsInt = Value.ToInt(found[i + 1].Value);
                        if (qfuAsInt > 36 || qfuAsInt < 1)
                        {
                            throw new MetarChunkDecoderException(remainingMetar, newRemainingMetar, MetarChunkDecoderException.Messages.InvalidRunwayQFURunwayVisualRangeInformation, this);
                        }

                        // get distance unit
                        var rangeUnit = Value.Unit.Meter;
                        if (found[i + 5].Value == "FT")
                        {
                            rangeUnit = Value.Unit.Feet;
                        }
                        Tendency tendency = Tendency.NONE;
                        switch (found[i + 6].Value)
                        {
                        case "U":
                            tendency = Tendency.U;
                            break;

                        case "D":
                            tendency = Tendency.D;
                            break;

                        case "N":
                            tendency = Tendency.N;
                            break;
                        }
                        var observation = new RunwayVisualRange()
                        {
                            Runway       = found[i + 1].Value,
                            PastTendency = tendency,
                        };

                        if (!string.IsNullOrEmpty(found[i + 3].Value))
                        {
                            observation.Variable = true;
                            var min = string.IsNullOrEmpty(found[i + 3].Value) ? null : new Value(Value.ToInt(found[i + 3].Value).Value, rangeUnit);
                            var max = string.IsNullOrEmpty(found[i + 4].Value) ? null : new Value(Value.ToInt(found[i + 4].Value).Value, rangeUnit);
                            observation.VisualRangeInterval = new Value[] { min, max };
                        }
                        else
                        {
                            observation.Variable = false;
                            var v = string.IsNullOrEmpty(found[i + 4].Value) ? null : new Value(Value.ToInt(found[i + 4].Value).Value, rangeUnit);
                            observation.VisualRange = v;
                        }
                        runways.Add(observation);
                    }
                }
                result.Add(RunwaysVisualRangeParameterName, runways);
            }

            return(GetResults(newRemainingMetar, result));
        }
Example #18
0
        public static void CreatePropertySeries(Level lvl, Tendency tend, string name, string formatA,
            int object1a, int value1a, int type1a, int step1a,
            int object2a = 0, int value2a = 0, int type2a = 0, int step2a = 0,
            int object3a = 0, int value3a = 0, int type3a = 0, int step3a = 0,
            string formatB = "",
            int object1b = 0, int value1b = 0, int type1b = 0, int step1b = 0,
            int object2b = 0, int value2b = 0, int type2b = 0, int step2b = 0,
            int object3b = 0, int value3b = 0, int type3b = 0, int step3b = 0,
            string formatC = "",
            int object1c = 0, int value1c = 0, int type1c = 0, int step1c = 0,
            int object2c = 0, int value2c = 0, int type2c = 0, int step2c = 0,
            int object3c = 0, int value3c = 0, int type3c = 0, int step3c = 0)
        {
            int pMax = (from d in LegacyToolBox.Data.ItemRandomProperty select d.ID).Max() + 1;
            int eMax = (from d in LegacyToolBox.Data.SpellItemEnchant select d.ID).Max() + 1;

            int level = (int)lvl;
            int tendency = (int)tend;

            item_suffix suffix = new item_suffix();
            suffix.Suffix = pMax;

            int p = 0;
            ItemRandomProperty property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank1 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank2 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank3 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank4 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank5 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank6 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank7 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank8 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank9 = property.ID;
            ++p;
            ++pMax;

            property = new ItemRandomProperty();
            property.ID = pMax;
            property.Name = name;
            if (formatA != "")
            {
                SpellItemEnchantment enchantA = CreateSpellItemEnchantment(eMax, formatA,
                    object1a, value1a + step1a * p, type1a,
                    object2a, value1a + step2a * p, type2a,
                    object3a, value3a + step3a * p, type3a);
                property.Enchant[0] = enchantA.ID;
                ++eMax;
            }
            if (formatB != "")
            {
                SpellItemEnchantment enchantB = CreateSpellItemEnchantment(eMax, formatB,
                    object1b, value1b + step1b * p, type1b,
                    object2b, value1b + step2b * p, type2b,
                    object3b, value3b + step3b * p, type3b);
                property.Enchant[0] = enchantB.ID;
                ++eMax;
            }
            if (formatC != "")
            {
                SpellItemEnchantment enchantC = CreateSpellItemEnchantment(eMax, formatC,
                    object1c, value1b + step1c * p, type1c,
                    object2c, value1b + step2c * p, type2c,
                    object3c, value3b + step3c * p, type3c);
                property.Enchant[0] = enchantC.ID;
                ++eMax;
            }
            LegacyToolBox.Data.ItemRandomProperty.Add(property);
            suffix.Rank10 = property.ID;
            DB.LEGACY.item_suffix.Add(suffix);
            DB.LSave();
        }
        private double tolerance = 0;//;.25;

        public DailyClassification(Candle candle,
                                   Tendency classification)
        {
            this.candle = candle;
            Tendency    = classification;
        }