예제 #1
0
 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));
     }
 }
예제 #2
0
 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));
     }
 }
예제 #3
0
 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);
     }
 }
예제 #4
0
 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();
 }