示例#1
0
        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());
        }
示例#2
0
        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);
        }
示例#3
0
 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);
                 }
             }
         }
     }
 }