/// <summary> /// Constructs a new Lumina object allowing access to game data. /// </summary> /// <param name="dataPath">Path to the sqpack directory</param> /// <param name="options">Options object to provide additional configuration</param> /// <exception cref="DirectoryNotFoundException">Thrown when the sqpack directory supplied is missing.</exception> public Lumina(string dataPath, LuminaOptions options = null) { Options = options ?? new LuminaOptions(); DataPath = new DirectoryInfo(dataPath); if (!DataPath.Exists) { throw new DirectoryNotFoundException("DataPath provided is missing."); } if (DataPath.Name != "sqpack") { throw new ArgumentException("the data path arg must point to the sqpack directory", nameof(dataPath)); } Repositories = new Dictionary <string, Repository>(); foreach (var repo in DataPath.GetDirectories()) { Repositories[repo.Name.ToLowerInvariant()] = new Repository(repo, this); } Excel = new ExcelModule(this); FileHandleManager = new FileHandleManager(this); }
/// <summary> /// Constructs a new Lumina object allowing access to game data. /// </summary> /// <param name="dataPath">Path to the sqpack directory</param> /// <param name="logger">An <see cref="ILogger"/> implementation that Lumina can send log events to</param> /// <param name="options">Options object to provide additional configuration</param> /// <exception cref="DirectoryNotFoundException">Thrown when the sqpack directory supplied is missing.</exception> public Lumina(string dataPath, ILogger logger, LuminaOptions options = null) : this(dataPath, options) { Logger = logger ?? throw new ArgumentNullException(nameof(logger)); }