Пример #1
0
 /*-----CONSTRUCTORES-----*/
 public Partida(Personaje p)
 {
     c = new ClaseAGuardar();
     c.Protagonista = p;
     c.X            = 1;
     c.Y            = 8;
 }
Пример #2
0
        public static void Guardar(ClaseAGuardar c)
        {
            IFormatter formatter = new BinaryFormatter();
            Stream     stream    = new FileStream(ruta, FileMode.Create, FileAccess.Write
                                                  , FileShare.None);

            formatter.Serialize(stream, c);
            stream.Close();
        }
Пример #3
0
        public static ClaseAGuardar Cargar()
        {
            ClaseAGuardar c = null;

            IFormatter formatter = new BinaryFormatter();
            Stream     stream    = new FileStream(ruta, FileMode.Open, FileAccess.Read
                                                  , FileShare.Read);

            c = (ClaseAGuardar)formatter.Deserialize(stream);
            stream.Close();

            return(c);
        }
Пример #4
0
        public void Run()
        {
            Bienvenida.Instancia.Lanzar();

            if (Bienvenida.NuevaPartida)
            {
                Introduccion a       = new Introduccion();
                Partida      partida = new Partida(a.Run());
                partida.Run();
            }
            else
            {
                ClaseAGuardar gameData = Serializador.Cargar();
                Partida       partida  = new Partida(gameData);
                partida.Run();
            }
        }
Пример #5
0
 public Inventory(ClaseAGuardar classRef)
 {
     this.classRef = classRef;
     c             = new Cursor(Console.BufferWidth / 2 - 4, 4, 5, 3, 0);
 }
Пример #6
0
 public Partida(ClaseAGuardar c)
 {
     this.c = c;
 }