Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
Arquivo: SRC.cs Projeto: 7474/SRC
        public SRC(ILoggerFactory loggerFactory)
        {
            Log = loggerFactory.CreateLogger("SRCCore");

            Help              = new Help(this);
            Event             = new Event(this);
            Expression        = new Expression(this);
            Map               = new Map(this);
            Commands          = new Commands.Command(this);
            Sound             = new Sound(this);
            Effect            = new Effect(this);
            COM               = new COM(this);
            InterMission      = new InterMission(this);
            FileHandleManager = new FileHandleManager();

            PDList  = new PilotDataList(this);
            NPDList = new NonPilotDataList(this);
            UDList  = new UnitDataList(this);
            IDList  = new ItemDataList(this);
            MDList  = new MessageDataList(this);
            EDList  = new MessageDataList(this);
            ADList  = new MessageDataList(this);
            EADList = new MessageDataList(this);
            DDList  = new DialogDataList(this);
            SPDList = new SpecialPowerDataList(this);
            ALDList = new AliasDataList(this);
            TDList  = new TerrainDataList(this);
            BCList  = new BattleConfigDataList(this);

            PList = new Pilots.Pilots(this);
            UList = new Units.Units(this);
            IList = new Items.Items(this);

            // XXX 別な実装をするならコンストラクタでは設定しない
            SystemConfig = new LocalFileConfig();
        }