当前位置: 首页>>代码示例>>C#>>正文


C# Buff.ToString方法代码示例

本文整理汇总了C#中Buff.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Buff.ToString方法的具体用法?C# Buff.ToString怎么用?C# Buff.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Buff的用法示例。


在下文中一共展示了Buff.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCustomChartData

        public override ComparisonCalculationBase[] GetCustomChartData(Character character, string chartName)
        {
            int i = customChartNames.FindIndex(x => x == chartName);
            if(i < 0)
                return new ComparisonCalculationBase[0];
            //if(i <= 4)
            {
                List<ComparisonCalculationBase> chart = new List<ComparisonCalculationBase>();
                CharacterCalculationsTree calcsBase = GetCharacterCalculations(character) as CharacterCalculationsTree;
                Character c2 = character.Clone();

                bool curIsBreakpoint = false;
                int[] hasteBreakpoints = GetHasteBreakpoints(character, 5000);
                foreach(int hb in hasteBreakpoints)
                {
                    float hasteDelta = hb - calcsBase.BasicStats.HasteRating;
                    float curHasteDelta;

                    Buff buff = new Buff();
                    buff.Name = "Haste adjustment to meet breakpoint";
                    buff.Stats.HasteRating += hasteDelta;
                    bool stop = false;

                    if(i == 6)
                    {
                        if (hasteDelta > calcsBase.BasicStats.Intellect)
                            stop = true;
                        buff.Stats.Intellect -= hasteDelta;
                    }
                    else
                    {
                        int[] ratings = new int[3];
                        int critPos = i >> 1;
                        ratings[critPos] = 0; // crit
                        ratings[critPos == 0 ? 1 : 0] = 1 + (i & 1);
                        ratings[critPos == 2 ? 1 : 2] = 2 - (i & 1);

                        for(int j = 0; j < 3; ++j)
                        {
                            switch(ratings[j])
                            {
                                case 0:
                                    curHasteDelta = Math.Min(hasteDelta, calcsBase.BasicStats.CritRating);
                                    buff.Stats.CritRating -= curHasteDelta;
                                    hasteDelta -= curHasteDelta;
                                    break;
                                case 1:
                                    curHasteDelta = Math.Min(hasteDelta, calcsBase.BasicStats.MasteryRating);
                                    buff.Stats.MasteryRating -= curHasteDelta;
                                    hasteDelta -= curHasteDelta;
                                    break;
                                case 2:
                                    curHasteDelta = Math.Min(hasteDelta, calcsBase.BasicStats.Spirit);
                                    buff.Stats.Spirit -= curHasteDelta;
                                    hasteDelta -= curHasteDelta;
                                    break;
                            }
                        }

                        if (hasteDelta > calcsBase.BasicStats.Intellect)
                            stop = true;
                        buff.Stats.Intellect -= hasteDelta;
                    }
                    if (stop)
                        break;
                    
                    c2.ActiveBuffs.Add(buff);
                    CharacterCalculationsTree calcsCur = GetCharacterCalculations(c2) as CharacterCalculationsTree;
                    c2.ActiveBuffs.Remove(buff);

                    ComparisonCalculationBase comp = Calculations.GetCharacterComparisonCalculations(calcsBase, calcsCur, String.Format("{0,4:F0}", hb), false, false);
                    if (hb == calcsBase.BasicStats.HasteRating)
                        comp.Description = "Current Gear (and on a breakpoint)";
                    else
                        comp.Description = buff.ToString();

                    chart.Add(comp);
                }

                if (!curIsBreakpoint)
                {
                    ComparisonCalculationBase comp = Calculations.GetCharacterComparisonCalculations(calcsBase, calcsBase, String.Format("{0,4:F0}" + (curIsBreakpoint ? "" : "(-)"), calcsBase.BasicStats.HasteRating), true, false);
                    comp.Description = "Current Gear (not on a breakpoint)";
                    chart.Add(comp);
                }

                return chart.ToArray();
            }
        }
开发者ID:LucasPeacecraft,项目名称:rawr,代码行数:89,代码来源:CalculationsTree.cs


注:本文中的Buff.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。