public void load(String filename) { init(); String[] lines = File.ReadAllLines(filename); for (int i = 0; i < lines.Count(); i++) { String[] token = lines[i].Split(','); int x = Int32.Parse(token[0]); int y = Int32.Parse(token[1]); Candy c = Candy.FromString(token[2]); CellType ct = (CellType)Enum.Parse(typeof(CellType), token[3]); table[x, y] = c; cell[x, y] = ct; } Console.WriteLine("load " + filename + " " + lines.Count()); }