public void Write(string w, string b, string r) { CTour t = new CTour(w, b, r); list.Add(t); using (StreamWriter file = new StreamWriter(path, true)) file.WriteLine(t.SaveToString()); }
public int DeletePlayer(string p) { int c = list.Count; for (int n = list.Count - 1; n >= 0; n--) { CTour t = list[n]; if ((t.w == p) || (t.b == p)) { list.RemoveAt(n); } } SaveToFile(); return(c - list.Count); }
public void LoadFromFile() { list.Clear(); if (File.Exists(path)) { using (StreamReader file = new StreamReader(path)) { string line; while ((line = file.ReadLine()) != null) { CTour t = new CTour(line); if (t.r != "") { list.Add(t); } } } } }