예제 #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();
        }
예제 #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);
        }
예제 #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();
     }
 }