Exemplo n.º 1
0
        public ExdDataCache()
        {
            void PopulateStringList(string sheetName, string fieldName, ref List <string> list)
            {
                var sheet = ExdReader.GetSheet(sheetName);

                if (sheet != null)
                {
                    for (var i = 0; i < sheet.Count; ++i)
                    {
                        list.Add(ExdReader.GetExdFieldAsString(sheetName, i, fieldName) ?? "");
                    }
                }
            }

            PopulateStringList("BNpcName", "Singular", ref _bnpcnames);
            PopulateStringList("PlaceName", "Name", ref _placenames);
            PopulateStringList("Action", "Name", ref _actionnames);

            var fateSheet = ExdReader.GetSheet("Fate");

            if (fateSheet != null)
            {
                for (var i = 0; i < fateSheet.Count; ++i)
                {
                    _fatenames.Add(i, ExdReader.GetExdFieldAsString("Fate", i, "Name") ?? "");
                }
            }
        }