public void test() { ActionManagerData = new ActionManagerData(); for (int i = 0; i < 10; ++i) { ActionManagerData.ActionsInProgress.Add(new ActionInProgressData(i, i * 3, i * 5, 0.5f)); } }
public void save(ActionManagerData actionManagerData) { foreach (ChunkAction chunkAction in _actionInProgress) { float remainingDistance = 0.0f; if (chunkAction.hasAnimation()) { ChunkAnimation animation = AnimationManager.GetInstance().getCurrentAnimationInAChunk(chunkAction.chunk); remainingDistance = animation.remainingDistance; } actionManagerData.ActionsInProgress.Add(new ActionInProgressData(chunkAction.id, chunkAction.hoursElapsed, chunkAction.chunk, remainingDistance)); } }
public void load(ActionManagerData actionManagerData) { //public ChunkAction(int aID, bool aIsRequired, bool aHasPenalization, string aTitle, string aInfo, int aDuration, bool hasToAddAsDone, bool isCanalNeeded, int neededWorkers) foreach (ActionInProgressData data in actionManagerData.ActionsInProgress) { ChunkAction newAction = _action[data.ID]; PerformChunkAction callback = this.addActionInProgress; ChunkAction t = newAction.copyWithCallback(callback, data.ChunkNumber); t.hoursElapsed = data.HoursElapsed; if (t.hasAnimation()) { t.starAnimationWithRemainingDistance(data.AnimationRemainingDistance); } t.performChunkAction(t); } }
public GameSaveData() { ActionManagerData = new ActionManagerData(); BuildingManagerData = new BuildingManagerData(); TimeManagerData = new TimeManagerData(); CoopManagerData = new CoopManagerData(); UserDataManagerData = new UserDataManagerData(); InvestigationManagerData = new InvestigationManagerData(); LogicManagerData = new LogicManagerData(); CanalManagerData = new CanalManagerData(); PenalizationManagerData = new PenalizationManagerData(); PhaseManagerData = new PhaseManagerData(); PlagueManagerData = new PlagueManagerData(); RankingManagerData = new RankingManagerData(); RiceObjectManagerData = new RiceObjectManagerData(); WeedFactoryData = new WeedFactoryData(); WorkerManagerData = new WorkerManagerData(); WorldTerrainData = new WorldTerrainData(); tutorialManagerData = new TutorialManagerData(); }