Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// Represents a loadable save game in memory.
- /// </summary>
- [Serializable]
- public class SaveGameData
- {
- /// <summary>
- /// Initializes the arbitrary progression data.
- /// </summary>
- /// <param name="numVars">The number of persistent script variables that should be stored.</param>
- /// <param name="numFlags">The number of persistent script flags that should be stored.</param>
- public SaveGameData(int numVars = 0x800, int numFlags = 0x1000)
- {
- PersistentVars = new int[numVars];
- Flags = new bool[numFlags];
- }
- // TODO: Player position, inventory, etc.
- // Arbitrary progression data
- public int[] PersistentVars;
- public bool[] Flags;
- /// <summary>
- /// Creates a new instance of SaveGameData that contains identical data.
- /// </summary>
- public SaveGameData Clone()
- {
- SaveGameData clone = new SaveGameData(PersistentVars.Length, Flags.Length);
- for (int var = 0; var < PersistentVars.Length; var++)
- clone.PersistentVars[var] = PersistentVars[var];
- for (int flag = 0; flag < Flags.Length; flag++)
- clone.Flags[flag] = Flags[flag];
- return clone;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement