public void deserialize() { IFormatter formatter = new BinaryFormatter(); Stream stream = new FileStream(worldSave.Name, FileMode.Open, FileAccess.Read, FileShare.Read); world = (World)formatter.Deserialize(stream); stream.Close(); }
public NPC(string name, string description, Stats stats, World world) { this.name = name; this.description = description; this.stats = stats; this.world = world; this.isMobile = true; }
private void initWorld() { if (worldSave.Exists) { logger.log("loading saved world"); deserialize(); } else { logger.log("save file not found, loading new world"); world = new World(); } }