Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using System.IO;
- using Soccer.API;
- using Soccer.Commons;
- using Soccer.IBA;
- namespace DefensiveSucces
- {
- public class Exporter
- {
- public static void writeSimpleListWithTime<T>(List<T> l, string filename, string header)
- {
- StreamWriter sw = new StreamWriter(filename);
- sw.WriteLine(header);
- for (int i = 0; i < l.Count; i++)
- {
- sw.WriteLine($"{0.04 * i};{l[i]}");
- }
- sw.Close();
- }
- public static void writePacking(Dictionary<Player, List<int>> packingDict)
- {
- StreamWriter sw = new StreamWriter("packing.csv");
- string header = "";
- int longest = 0;
- foreach (var p in packingDict.Keys)
- {
- int c = packingDict[p].Count;
- longest = c > longest ? c : longest;
- header += p.obj_id;
- header += ';';
- }
- sw.WriteLine(header);
- for (int i = 0; i < longest; i++)
- {
- string line = "";
- foreach (var p in packingDict.Keys)
- {
- if (packingDict[p].Count > i)
- {
- line += packingDict[p][i];
- }
- line += ';';
- }
- sw.WriteLine(line);
- }
- sw.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement