コード例 #1
0
        public List <string> Choices(IChoiceProvider choiceProvider)
        {
            int           offset = choiceProvider.GetChoiceOffset(this, UniqueID, Amount);
            List <string> res    = new List <string>();

            for (int c = 0; c < Amount; c++)
            {
                String counter = "";
                if (c + offset > 0)
                {
                    counter = "_" + (c + offset).ToString();
                }
                Choice cho = choiceProvider.GetChoice(UniqueID + counter);
                if (cho != null && cho.Value != "")
                {
                    res.Add(cho.Value);
                }
            }
            return(res);
        }
コード例 #2
0
        public List <Language> getLanguages(IChoiceProvider provider, OGLContext context)
        {
            List <Language> res    = new List <Language>();
            int             offset = provider.GetChoiceOffset(this, UniqueID, Amount);

            for (int c = 0; c < Amount; c++)
            {
                String counter = "";
                if (c + offset > 0)
                {
                    counter = "_" + (c + offset).ToString();
                }
                Choice cho = provider.GetChoice(UniqueID + counter);
                if (cho != null && cho.Value != "")
                {
                    res.Add(context.GetLanguage(cho.Value, Source));
                }
            }
            return(res);
        }
コード例 #3
0
        public override List <Feature> Collect(int level, IChoiceProvider choiceProvider, OGLContext context)
        {
            if (Level > level)
            {
                return(new List <Feature>());
            }
            List <Feature> res = new List <Feature>()
            {
                this
            };
            int offset = choiceProvider.GetChoiceOffset(this, UniqueID, Amount);

            for (int c = 0; c < Amount; c++)
            {
                String counter = "";
                if (c + offset > 0)
                {
                    counter = "_" + (c + offset).ToString();
                }
                Choice         cho     = choiceProvider.GetChoice(UniqueID + counter);
                List <Feature> choices = Choices;
                if (AllowSameChoice)
                {
                    choices = getCopy(c);
                }
                if (cho != null && cho.Value != "")
                {
                    Feature feat = choices.Find(fe => fe.Name + " " + ConfigManager.SourceSeperator + " " + fe.Source == cho.Value);
                    if (feat == null)
                    {
                        feat = choices.Find(fe => ConfigManager.SourceInvariantComparer.Equals(fe.Name + " " + ConfigManager.SourceSeperator + " " + fe.Source, cho.Value));
                    }
                    if (feat != null)
                    {
                        res.AddRange(feat.Collect(level, choiceProvider, context));
                    }
                }
            }
            return(res);
        }