示例#1
0
        public void ParseVOSet(string text, Dictionary <string, int> VOMapping)
        {
            int missingID = 0;
            int voCount   = Regex.Matches(text, "DCG_VO").Count;

            Regex voRegex = new Regex(@"""DCG_VO_(.*?)""\s+""(.*?)""");
            var   result  = voRegex.Matches(text);

            Console.WriteLine($"VO count of {voCount}; found {result.Count} full matches.");

            foreach (Match match in result)
            {
                string fullname = match.Groups[1].Value;
                string name     = VOMapping.Keys.Where(x => fullname.StartsWith(x)).FirstOrDefault();
                int    id       = 0;
                if (name == null)
                {
                    Console.WriteLine($"{fullname} not found in the VO mapping!");
                    id = --missingID;
                }
                else
                {
                    id = VOMapping[name];
                }

                CardVoiceOver vo = new CardVoiceOver()
                {
                    ID              = id,
                    Name            = fullname,
                    CharacterName   = name,
                    ResponseTrigger = fullname.Replace($"{name}_", ""),
                    RawText         = match.Groups[2].Value
                };

                if (!Voiceover.ContainsKey(id))
                {
                    Voiceover[id] = new List <CardVoiceOver>();
                }

                Voiceover[id].Add(vo);
            }
        }
示例#2
0
 public (CardText, CardLore, List <CardVoiceOver>) GetGameFileData(int id)
 {
     return(Text.GetValueOrDefault(id), Lore.GetValueOrDefault(id), Voiceover.GetValueOrDefault(id, new List <CardVoiceOver>()));
 }