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