示例#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;
 }