public void Generate() { HistoricalDataPoint dataPoint = new HistoricalDataPoint(round.FightResult()); AddDatapoint(dataPoint); this.Size++; string history = "history.csv"; File.AppendAllText(history, dataPoint.DataPoint + "\n"); }
public void Load() { string file = "history.csv"; if (File.Exists(file)) { string[] historialData = System.IO.File.ReadAllLines(file); foreach (var item in historialData) { HistoricalDataPoint nextDataPoint = new HistoricalDataPoint(item); AddDatapoint(nextDataPoint); this.Size++; } } else { var myFile = File.Create(file); myFile.Close(); } }
internal void AddDatapoint(HistoricalDataPoint dataPoint) { _DataPoints.Add(dataPoint); }