public void Save() //TODO Saving function { string path = Path.Combine(Application.persistentDataPath, isleName); using (BinaryWriter writer = new BinaryWriter(File.Open(Path.Combine(path, "world.dat"), FileMode.Create))) { writer.Write(0); writer.Write(Clock.GetTime()); } using (BinaryWriter writer = new BinaryWriter(File.Open(Path.Combine(path, "map.dat"), FileMode.Create))) { writer.Write(2); grid.Save(writer); } entities.Save(path); }
public void Save() //TODO Saving function { string path = IslePath; //Path.Combine(Application.persistentDataPath, isleName); using (BinaryWriter writer = new BinaryWriter(File.Open(Path.Combine(path, "thumbnail.dat"), FileMode.Create))) { writer.Write(isleX); writer.Write(isleZ); } using (BinaryWriter writer = new BinaryWriter(File.Open(Path.Combine(path, "world.dat"), FileMode.Create))) { writer.Write(0); writer.Write(Clock.GetTime()); } using (BinaryWriter writer = new BinaryWriter(File.Open(Path.Combine(path, "map.dat"), FileMode.Create))) { writer.Write(2); grid.Save(writer); } entities.Save(path); File.WriteAllBytes(Path.Combine(path, "thumbnailImg.png"), GenerateThumb().EncodeToPNG()); }