Beispiel #1
0
 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();
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 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();
     }
 }