/*-----CONSTRUCTORES-----*/ public Partida(Personaje p) { c = new ClaseAGuardar(); c.Protagonista = p; c.X = 1; c.Y = 8; }
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(); }
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); }
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(); } }
public Inventory(ClaseAGuardar classRef) { this.classRef = classRef; c = new Cursor(Console.BufferWidth / 2 - 4, 4, 5, 3, 0); }
public Partida(ClaseAGuardar c) { this.c = c; }