コード例 #1
0
 private BuffChartDataDto(BuffsGraphModel bgm, List <Segment> bChart, PhaseData phase)
 {
     Id      = bgm.Buff.ID;
     Visible = (bgm.Buff.Name == "Might" || bgm.Buff.Name == "Quickness" || bgm.Buff.Name == "Vulnerability");
     Color   = HTMLBuilder.GetLink("Color-" + bgm.Buff.Name);
     States  = Segment.ToObjectList(bChart, phase.Start, phase.End);
 }
コード例 #2
0
        public static List <int[]> GetBuffStates(BuffsGraphModel bgm)
        {
            if (bgm == null || bgm.BuffChart.Count == 0)
            {
                return(null);
            }
            var res = bgm.BuffChart.Select(x => new int[2] {
                (int)x.Start, (int)x.Value
            }).ToList();

            return(res.Count > 0 ? res : null);
        }
コード例 #3
0
        private static BuffChartDataDto BuildBuffGraph(BuffsGraphModel bgm, PhaseData phase, Dictionary <long, Buff> usedBuffs)
        {
            var bChart = bgm.BuffChart.Where(x => x.End >= phase.Start && x.Start <= phase.End
                                             ).ToList();

            if (bChart.Count == 0 || (bChart.Count == 1 && bChart.First().Value == 0))
            {
                return(null);
            }
            usedBuffs[bgm.Buff.ID] = bgm.Buff;
            return(new BuffChartDataDto(bgm, bChart, phase));
        }
コード例 #4
0
        public BuffChartDataDto(BuffsGraphModel bgm, List <BuffSegment> bChart, PhaseData phase)
        {
            Id      = bgm.Buff.ID;
            Visible = (bgm.Buff.Name == "Might" || bgm.Buff.Name == "Quickness" || bgm.Buff.Name == "Vulnerability");
            Color   = GeneralHelper.GetLink("Color-" + bgm.Buff.Name);
            States  = new List <object[]>(bChart.Count + 1);
            foreach (BuffSegment seg in bChart)
            {
                double segStart = Math.Round(Math.Max(seg.Start - phase.Start, 0) / 1000.0, GeneralHelper.TimeDigit);
                States.Add(new object[] { segStart, seg.Value });
            }
            BuffSegment lastSeg = bChart.Last();
            double      segEnd  = Math.Round(Math.Min(lastSeg.End - phase.Start, phase.End - phase.Start) / 1000.0, GeneralHelper.TimeDigit);

            States.Add(new object[] { segEnd, lastSeg.Value });
        }