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; } } } }); }
void IDataFromStorageToModelUpdater.UpdateModel() { readerWriter.ReadAllData(receivedData => { IModelInteraction modelInteraction = dataHandlerInteraction.LastGamingSessions; modelInteraction.SetData(new PlayerGameData(CombineDataFromStorages(modelInteraction.GetData(), receivedData))); }); }