public void F1(snake Snake) { FileStream v = new FileStream("date1.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(v, Snake); v.Close(); }
public snake F2() { FileStream v = new FileStream("date1.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite); BinaryFormatter bf = new BinaryFormatter(); snake Snake2 = bf.Deserialize(v) as snake; v.Close(); return(Snake2); }
public Game(int a) { if (a == 1) { Snake = new snake(); wall = new Wall(1); Snake.record = seri.F6(); Game.speed = 200; } else { Snake = seri.F2(); wall = seri.F4(); Snake.record = seri.F6(); } }