public void SaveVersion(SC2VersionEntity verion) { var info = InfoEntityConverter.Convert(verion); var dataAccess = new SC2VersionsDataAccess(new JsonStorageDataAccess(), "Versions//"); dataAccess.SaveSC2VersionInfo(info); }
public static SC2VersionEntity GetVersionEntity() { var result = new SC2VersionEntity(); result.VersionID = "2.2.0"; result.AddonID = "HOTS"; result.GlobalConstants = GetGlobalConstants(); result.RaceSettingsDictionary = new RaceSettingsEntityDictionary(); result.RaceSettingsDictionary.AddRaceSettings(GetZergRaceSettings()); result.RaceSettingsDictionary.AddRaceSettings(GetProtossRaceSettings()); result.RaceSettingsDictionary.AddRaceSettings(GetTerranRaceSettings()); return(result); }
public static SC2VersionInfo Convert(SC2VersionEntity item) { var result = new SC2VersionInfo { VersionID = item.VersionID, AddonID = item.AddonID, GlobalSettings = item.GlobalConstants, }; foreach (var entity in item.RaceSettingsDictionary.GetRaceSettingsList()) { var info = Convert(entity); result.RaceSettingsList.Add(info); } return(result); }
public static SC2VersionEntity Convert(SC2VersionInfo item) { var result = new SC2VersionEntity { VersionID = item.VersionID, AddonID = item.AddonID, GlobalConstants = item.GlobalSettings, RaceSettingsDictionary = new RaceSettingsEntityDictionary() }; foreach (var raceSettingsInfo in item.RaceSettingsList) { var raceSettingsEntity = Convert(raceSettingsInfo); result.RaceSettingsDictionary.AddRaceSettings(raceSettingsEntity); } return(result); }
public void SaveVersion(SC2VersionEntity versionEntity) { var info = InfoEntityConverter.Convert(versionEntity); this.mDataAccess.SaveSC2VersionInfo(info); }