Пример #1
0
 public void DoSmartFind(SmartFindOptions options, List <SmartFindResults> results)
 {
     foreach (var fileMapValue in FileMap.Values)
     {
         fileMapValue.DoSmartFind(options, results);
     }
 }
Пример #2
0
        private bool CheckNameMatchSmartFind(SmartFindOptions options)
        {
            if (options.SearchRHS && MatchTextSmartFind(options, GetStringValue()))
            {
                return(true);
            }

            if (options.SearchLHS)
            {
                return(MatchTextSmartFind(options, Name));
            }

            return(false);
        }
Пример #3
0
        private bool CheckMatchesSmartFind(SmartFindOptions options)
        {
            if (!options.ScopesToSearch.Contains(GetScopeType()))
            {
                return(false);
            }

            if (!options.SearchOverridden &&
                Overridden)
            {
                return(false);
            }

            return(true);
        }
Пример #4
0
        public List <SmartFindResults> DoSmartFind(SmartFindOptions options)
        {
            var results = new List <SmartFindResults>();

            if (options.SearchBase)
            {
                BaseCK3Library.DoSmartFind(options, results);
            }

            if (options.SearchMod)
            {
                ModCK3Library.DoSmartFind(options, results);
            }

            return(results);
        }
Пример #5
0
        private bool MatchTextSmartFind(SmartFindOptions options, string str)
        {
            if (str == null)
            {
                return(false);
            }

            var toFind = options.TextToFind;

            if (!options.CaseSensitive)
            {
                str    = str.ToLower();
                toFind = toFind.ToLower();
            }

            if (options.FindWholeWorld)
            {
                return(str == toFind);
            }
            return(str.Contains(toFind));
        }
Пример #6
0
        public void DoSmartFind(SmartFindOptions options, List <SmartFindResults> results)
        {
            if (BehaviourData == null)
            {
                return;
            }

            if (CheckMatchesSmartFind(options))
            {
                if (CheckNameMatchSmartFind(options))
                {
                    var r = new SmartFindResults();
                    r.ScriptObject = this;
                    r.IsModResult  = !Topmost.ScriptFile.IsBase;
                    results.Add(r);
                }
            }

            foreach (var scriptObject in Children)
            {
                scriptObject.DoSmartFind(options, results);
            }
        }