Esempio n. 1
0
 private void LoadSettings()
 {
     if (File.Exists(StaticSerializer.FullPath_Settings))
     {
         MySettings = (EcsSettings)StaticSerializer.DeSerializeObject(StaticSerializer.FullPath_Settings);
     }
     if (MySettings == null)
     {
         MySettings = new EcsSettings();
     }
     MySettings.SettingsChanged += (s, args) => StaticSerializer.SerializeObject(MySettings, StaticSerializer.FullPath_Settings);
 }
Esempio n. 2
0
 private void LoadAllChampions()
 {
     AllChampions = new ChampionList("AllChampions");
     LoadAllChampionsRiotApi(); //Use api to get all champions
     if (AllChampions.getCount() < 1)
     {
         LoadAllChampionsLocal();
     }
     AllChampions.ChampionsChanged += (s, args) => StaticSerializer.SerializeObject(AllChampions, StaticSerializer.FullPath_AllChampions);
     if (!File.Exists(StaticSerializer.FullPath_AllChampions))
     {
         StaticSerializer.SerializeObject(AllChampions, StaticSerializer.FullPath_AllChampions);
     }
 }
Esempio n. 3
0
 private void LoadSerializedGroupManager()
 {
     if (File.Exists(StaticSerializer.FullPath_GroupManager))
     {
         MyGroupManager = (StaticGroupManager)StaticSerializer.DeSerializeObject(StaticSerializer.FullPath_GroupManager);
     }
     if (MyGroupManager == null)
     {
         NewGroupManager();
     }
     MyGroupManager.GroupsChanged += (s, args) => StaticSerializer.SerializeObject(MyGroupManager, StaticSerializer.FullPath_GroupManager);
     for (int i = 0; i < MyGroupManager.GroupCount; i++)
     {
         MyGroupManager.getGroup(i).ChampionsChanged += (s, args) => StaticSerializer.SerializeObject(MyGroupManager, StaticSerializer.FullPath_GroupManager);
     }
 }