- Timestamp:
- Aug 7, 2022, 3:02:24 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements2/7dtd-server-fixes/src/PersistentData/PersistentContainer.cs
r369 r391 10 10 [OptionalField] private Attributes attributes; 11 11 12 public Players Players { 13 get { 14 if (players == null) { 15 players = new Players (); 16 } 12 public Players Players => players ?? (players = new Players ()); 17 13 18 return players; 19 } 20 } 21 22 public Attributes Attributes { 23 get { 24 if (attributes == null) { 25 attributes = new Attributes (); 26 } 27 28 return attributes; 29 } 30 } 14 public Attributes Attributes => attributes ?? (attributes = new Attributes ()); 31 15 32 16 private static PersistentContainer instance; 33 17 34 public static PersistentContainer Instance { 35 get { 36 if (instance == null) { 37 instance = new PersistentContainer (); 38 } 39 40 return instance; 41 } 42 } 18 public static PersistentContainer Instance => instance ?? (instance = new PersistentContainer ()); 43 19 44 20 private PersistentContainer () { … … 58 34 59 35 try { 60 PersistentContainer obj;61 36 Stream stream = File.Open (GameIO.GetSaveGameDir () + "/AllocsPeristentData.bin", FileMode.Open); 62 37 BinaryFormatter bFormatter = new BinaryFormatter (); 63 obj = (PersistentContainer) bFormatter.Deserialize (stream);38 PersistentContainer obj = (PersistentContainer) bFormatter.Deserialize (stream); 64 39 stream.Close (); 65 40 instance = obj;
Note:
See TracChangeset
for help on using the changeset viewer.