public void Load(PlayerClass playerClass)
{
var windowFile = Path.Combine(_basicData.ResourceDirectory, "config/events/events-" + playerClass.ToString().ToLowerInvariant() + ".xml");
XDocument xml;
try
{
var filestreamClass = new FileStream(windowFile, FileMode.Open, FileAccess.Read);
xml = XDocument.Load(filestreamClass);
}
catch (Exception ex) when(ex is XmlException || ex is InvalidOperationException)
{
BasicTeraData.LogError(ex.Message, true, true);
Save();
return;
}
catch (Exception ex)
{
BasicTeraData.LogError(ex.Message, true, true);
return;
}
EventsClass = new Dictionary <Event, List <Action> >();
MissingAbnormalities = new Dictionary <Event, List <Action> >();
AddedRemovedAbnormalities = new Dictionary <Event, List <Action> >();
Cooldown = new Dictionary <Event, List <Action> >();
Events = new Dictionary <Event, List <Action> >();
AFK = null;
ParseAbnormalities(EventsClass, xml);
ParseCooldown(EventsClass, xml);
AssociateEvent(EventsCommon);
AssociateEvent(EventsClass);
}