Exemple #1
0
 void ISynchronizer.ReadDataFromStorage()
 {
     readerWriter.Read(loadedData =>
     {
         if (loadedData == null)
         {
             return;
         }
         else
         {
             if (cashData == null)
             {
                 cashData       = loadedData;
                 T combinedData = CombineData(model.GetData(), loadedData);
                 model.SetData(combinedData);
                 return;
             }
             else
             {
                 if (cashData.Equals(loadedData))
                 {
                     return;
                 }
                 else
                 {
                     ChooseData(loadedData, choosedData => model.SetData(choosedData));
                     return;
                 }
             }
         }
     });
 }
Exemple #2
0
 void IDataFromStorageToModelUpdater.UpdateModel()
 {
     readerWriter.ReadAllData(receivedData =>
     {
         IModelInteraction modelInteraction = dataHandlerInteraction.LastGamingSessions;
         modelInteraction.SetData(new PlayerGameData(CombineDataFromStorages(modelInteraction.GetData(), receivedData)));
     });
 }