Example #1
0
 public void CreateRecorders()
 {
     foreach (HistoryAutoRecorderDef historyAutoRecorderDef in this.def.historyAutoRecorderDefs)
     {
         HistoryAutoRecorder historyAutoRecorder = new HistoryAutoRecorder();
         historyAutoRecorder.def = historyAutoRecorderDef;
         this.recorders.Add(historyAutoRecorder);
     }
 }
Example #2
0
 public void AddOrRemoveHistoryRecorders()
 {
     if (recorders.RemoveAll((HistoryAutoRecorder x) => x == null) != 0)
     {
         Log.Warning("Some history auto recorders were null.");
     }
     foreach (HistoryAutoRecorderDef historyAutoRecorderDef in def.historyAutoRecorderDefs)
     {
         if (!recorders.Any((HistoryAutoRecorder x) => x.def == historyAutoRecorderDef))
         {
             HistoryAutoRecorder historyAutoRecorder = new HistoryAutoRecorder();
             historyAutoRecorder.def = historyAutoRecorderDef;
             recorders.Add(historyAutoRecorder);
         }
     }
     recorders.RemoveAll((HistoryAutoRecorder x) => x.def == null);
 }
 public void AddOrRemoveHistoryRecorders()
 {
     if (this.recorders.RemoveAll((HistoryAutoRecorder x) => x == null) != 0)
     {
         Log.Warning("Some history auto recorders were null.", false);
     }
     foreach (HistoryAutoRecorderDef recorderDef in this.def.historyAutoRecorderDefs)
     {
         if (!this.recorders.Any((HistoryAutoRecorder x) => x.def == recorderDef))
         {
             HistoryAutoRecorder historyAutoRecorder = new HistoryAutoRecorder();
             historyAutoRecorder.def = recorderDef;
             this.recorders.Add(historyAutoRecorder);
         }
     }
     this.recorders.RemoveAll((HistoryAutoRecorder x) => x.def == null);
 }
Example #4
0
        public void DrawGraph(Rect graphRect, Rect legendRect, FloatRange section, List <CurveMark> marks)
        {
            int ticksGame = Find.TickManager.TicksGame;

            if (ticksGame != cachedGraphTickCount)
            {
                cachedGraphTickCount = ticksGame;
                curves.Clear();
                for (int i = 0; i < recorders.Count; i++)
                {
                    HistoryAutoRecorder historyAutoRecorder = recorders[i];
                    SimpleCurveDrawInfo simpleCurveDrawInfo = new SimpleCurveDrawInfo();
                    simpleCurveDrawInfo.color  = historyAutoRecorder.def.graphColor;
                    simpleCurveDrawInfo.label  = historyAutoRecorder.def.LabelCap;
                    simpleCurveDrawInfo.labelY = historyAutoRecorder.def.GraphLabelY;
                    simpleCurveDrawInfo.curve  = new SimpleCurve();
                    for (int j = 0; j < historyAutoRecorder.records.Count; j++)
                    {
                        simpleCurveDrawInfo.curve.Add(new CurvePoint((float)j * (float)historyAutoRecorder.def.recordTicksFrequency / 60000f, historyAutoRecorder.records[j]), sort: false);
                    }
                    simpleCurveDrawInfo.curve.SortPoints();
                    if (historyAutoRecorder.records.Count == 1)
                    {
                        simpleCurveDrawInfo.curve.Add(new CurvePoint(1.66666669E-05f, historyAutoRecorder.records[0]));
                    }
                    curves.Add(simpleCurveDrawInfo);
                }
            }
            if (Mathf.Approximately(section.min, section.max))
            {
                section.max += 1.66666669E-05f;
            }
            SimpleCurveDrawerStyle curveDrawerStyle = Find.History.curveDrawerStyle;

            curveDrawerStyle.FixedSection       = section;
            curveDrawerStyle.UseFixedScale      = def.useFixedScale;
            curveDrawerStyle.FixedScale         = def.fixedScale;
            curveDrawerStyle.YIntegersOnly      = def.integersOnly;
            curveDrawerStyle.OnlyPositiveValues = def.onlyPositiveValues;
            SimpleCurveDrawer.DrawCurves(graphRect, curves, curveDrawerStyle, marks, legendRect);
            Text.Anchor = TextAnchor.UpperLeft;
        }
Example #5
0
 public void AddOrRemoveHistoryRecorders()
 {
     if (this.recorders.RemoveAll((HistoryAutoRecorder x) => x == null) != 0)
     {
         Log.Warning("Some history auto recorders were null.", false);
     }
     using (List <HistoryAutoRecorderDef> .Enumerator enumerator = this.def.historyAutoRecorderDefs.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             HistoryAutoRecorderDef recorderDef = enumerator.Current;
             if (!this.recorders.Any((HistoryAutoRecorder x) => x.def == recorderDef))
             {
                 HistoryAutoRecorder historyAutoRecorder = new HistoryAutoRecorder();
                 historyAutoRecorder.def = recorderDef;
                 this.recorders.Add(historyAutoRecorder);
             }
         }
     }
     this.recorders.RemoveAll((HistoryAutoRecorder x) => x.def == null);
 }
Example #6
0
 internal bool <> m__0(HistoryAutoRecorder x)
 {
     return(x.def == this.recorderDef);
 }
Example #7
0
 private static bool <AddOrRemoveHistoryRecorders> m__1(HistoryAutoRecorder x)
 {
     return(x.def == null);
 }