Пример #1
0
        public NepEntryManager(string _name, string _rootPath, string _dataPath)
        {
            GameScriptEntries   = new Dictionary <string, Entry>();
            SystemScriptEntries = new Dictionary <string, Entry>();
            //EntriesTree = new TreeNode("_zero_");

            Name           = _name;
            RootDirectory  = _rootPath;
            NepDataRootDir = _dataPath;

            {
                NepError error = ValidateDirectoryStructure();
                if (error.ErrorCode != NepErrCode.NoError)
                {
                    Logger.Log(error.ToString());
                    throw new Exception($"Entry Manager '{Name}' instantiation failure.");
                }
            }

            {
                NepError error = PopulateData();
                if (error.ErrorCode != NepErrCode.NoError)
                {
                    Logger.Log(error.ToString());
                    throw new Exception($"Entry Manager '{Name}' data population failure. Please reopen the program.");
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Populate the data and store them in working space.
        /// NOTE that this will not check for directory structure damage,
        /// so be sure to call ValidateDirectoryStructure() beforehand.
        /// </summary>
        public NepError PopulateData()
        {
            NepError error = ValidateDirectoryStructure();

            if (error.ErrorCode != NepErrCode.NoError)
            {
                Logger.Log("Error occurred when validate directory structure before populate data.");
                return(error);
            }

            // ===== GAME00000 =====
            Logger.Log("");
            if (!ParseGameScriptEntries())
            {
                Logger.Log("No script found in Game Script directory. Please verify and try again.");
            }

            // ===== SYSTEM00000 =====
            Logger.Log("");
            if (!ParseSystemScriptEntries())
            {
                Logger.Log("No script found in System Script directory. Please verify and try again.");
            }

            Logger.BatchLog("===== Data Populating Successfully =====");
            Logger.BatchLog("========================================");
            Logger.FlushBatchLog();

            return(NepError.NoError); // TODO: remove this;
        }
Пример #3
0
        private void SaveProject()
        {
            if (MainGameEntryManager == null)
            {
                return;
            }
            Logger.Log("========================================");
            Logger.Log("    Saving data...");
            NepError err = MainGameEntryManager.SaveData();

            Logger.Log(err.ToString());
        }