Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using SpaceMonkeys.Rpg;
- using SpaceMonkeys.Core;
- namespace SpaceMonkeys.Idle.DungeonExplorer
- {
- [System.Serializable]
- public class SaveData
- {
- /* This represents all the data needed for saving/loading the game
- ** Need to save:
- ** All exploration zones - which captures all items within
- ** All adventurers - not created yet
- ** All metrics and stats - in progress
- *****
- ** v0.1 - starter save file format
- ** v0.2 - added PlayTime for tracking offline progression
- */
- #region Members
- public float SaveFormat = 0.2f;
- public List<ZoneData> Zones = new List<ZoneData>(); // Exploration Zones
- public PlayTime GameTime = default;
- #endregion Members
- #region Ctors
- public SaveData() { } // for loading a game
- public SaveData(List<ExplorationZone> zones) // for saving a game
- {
- foreach (var item in zones)
- {
- Zones.Add((ZoneData)item);
- }
- // TODO add GameTime processing
- GameTime = MetricsManager.Instance.GameTime;
- }
- #endregion Ctors
- }
- [System.Serializable]
- public class ZoneData
- {
- #region Members
- public ExplorationZoneType ZoneType;
- public bool IsZoneActive;
- public List<Quest> Quests = new List<Quest>();
- public ResearchManager ResearchTree = default;
- public Stat MaxLocations;
- #endregion Members
- #region Ctors
- public ZoneData(ExplorationZone data)
- {
- ZoneType = data.ZoneType;
- IsZoneActive = data.IsZoneActive;
- foreach (var item in data.Locations)
- {
- Quests.Add(item.Quest);
- }
- ResearchTree = data.ResearchTree;
- MaxLocations = data.MaxLocations;
- }
- #endregion Ctors
- #region Operators
- public static explicit operator ZoneData(ExplorationZone zone) => new ZoneData(zone);
- #endregion Operators
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement