public virtual bool SetupDependencies() { _registry.RegisterDiscoveredTypes(); var initializers = _registry.ResolveAll <IGameInitializer>(); try { foreach (var initializer in initializers) { initializer.Initialize(); } } catch (ConfigLoadException cle) { ShowErrorMessage(cle.Message, "Error loading config file!"); return(false); } catch (DataFileLoadException dfle) { ShowErrorMessage(dfle.Message, "Error loading data files!"); return(false); } catch (DirectoryNotFoundException dnfe) { ShowErrorMessage(dnfe.Message, "Missing required directory"); return(false); } catch (FileNotFoundException fnfe) { ShowErrorMessage(fnfe.Message, "Missing required file"); return(false); } catch (LibraryLoadException lle) { var message = $"There was an error loading GFX{(int) lle.WhichGFX:000}.EGF : {lle.WhichGFX}. Place all .GFX files in .\\gfx\\. The error message is:\n\n\"{lle.Message}\""; ShowErrorMessage(message, "GFX Load Error"); return(false); } return(true); }