public List <Feature> CollectFeatures(int level, bool secondClass, IChoiceProvider provider, OGLContext context)
        {
            List <Feature> res = new List <Feature>();

            foreach (Feature f in Features)
            {
                f.Source = Source;
                res.AddRange(f.Collect(level, provider, context));
            }
            if (secondClass)
            {
                foreach (Feature f in MulticlassingFeatures)
                {
                    f.Source = Source;
                    res.AddRange(f.Collect(level, provider, context));
                }
            }
            else
            {
                foreach (Feature f in FirstClassFeatures)
                {
                    f.Source = Source;
                    res.AddRange(f.Collect(level, provider, context));
                }
            }
            return(res);
        }
        public IEnumerable <Feature> Collect(int level, bool equipped, bool attuned, IChoiceProvider choiceProvider, OGLContext context)
        {
            List <Feature> res = new List <Feature>();

            foreach (Feature f in CarryFeatures)
            {
                f.Source = Source;
                res.AddRange(f.Collect(level, choiceProvider, context));
            }
            if (equipped)
            {
                foreach (Feature f in EquipFeatures)
                {
                    f.Source = Source;
                    res.AddRange(f.Collect(level, choiceProvider, context));
                }
            }
            if (attuned)
            {
                foreach (Feature f in AttunementFeatures)
                {
                    f.Source = Source;
                    res.AddRange(f.Collect(level, choiceProvider, context));
                }
            }
            if (attuned && equipped)
            {
                foreach (Feature f in AttunedEquipFeatures)
                {
                    f.Source = Source;
                    res.AddRange(f.Collect(level, choiceProvider, context));
                }
            }
            return(res);
        }
Exemple #3
0
 public IEnumerable <ClassDefinition> GetClasses(int level, IChoiceProvider provider)
 {
     if (level > 1)
     {
         return(from c in Classes.Values where provider.CanMulticlass(c, level) select c);
     }
     return(from c in Classes.Values where c.AvailableAtFirstLevel select c);
 }
        public List <Feature> CollectFeatures(int level, IChoiceProvider provider, OGLContext context)
        {
            List <Feature> res = new List <Feature>();

            foreach (Feature f in Features)
            {
                res.AddRange(f.Collect(level, provider, context));
            }
            return(res);
        }
Exemple #5
0
        public IEnumerable <Feature> CollectOnUse(int level, IChoiceProvider provider)
        {
            List <Feature> result = new List <Feature>();

            foreach (string mp in MagicProperties)
            {
                result.AddRange(MagicProperty.Get(mp, null).CollectOnUse(level, provider, Attuned));
            }
            return(result);
        }
        public IEnumerable <Feature> CollectOnUse(int level, IChoiceProvider provider, OGLContext context)
        {
            Context = context;
            List <Feature> result = new List <Feature>();

            foreach (string mp in MagicProperties)
            {
                result.AddRange(context.GetMagic(mp, null).CollectOnUse(level, provider, Attuned, context));
            }
            return(result);
        }
 public virtual List <Feature> Collect(int level, IChoiceProvider choiceProvider, OGLContext context)
 {
     if (Level > level)
     {
         return(new List <Feature>());
     }
     return(new List <Feature>()
     {
         this
     });
 }
Exemple #8
0
        public IEnumerable <Feature> Collect(int level, IChoiceProvider provider, bool pretendEquipped = false)
        {
            List <Feature> result = new List <Feature>();
            bool           equip  = !EquipSlot.None.Equals(Equipped, StringComparison.InvariantCultureIgnoreCase);

            foreach (string mp in MagicProperties)
            {
                result.AddRange(MagicProperty.Get(mp, null).Collect(level, equip || pretendEquipped, Attuned, provider));
            }
            return(result);
        }
 public List <Feature> FilterBoons(List <Feature> features, int level, IChoiceProvider provider, OGLContext context)
 {
     foreach (IPlugin i in plugins)
     {
         try { features = i.FilterBoons(features, level, provider, context); }
         catch (Exception e)
         {
             ConfigManager.LogError("Error in Plugin " + i.Name, e);
         }
     }
     return(features);
 }
        public IEnumerable <Feature> Collect(int level, IChoiceProvider provider, OGLContext context, bool pretendEquipped = false)
        {
            Context = context;
            List <Feature> result = new List <Feature>();
            bool           equip  = !EquipSlot.None.Equals(Equipped, StringComparison.OrdinalIgnoreCase);

            foreach (string mp in MagicProperties)
            {
                result.AddRange(context.GetMagic(mp, null).Collect(level, equip || pretendEquipped, Attuned, provider, context));
            }
            return(result);
        }
 public static LoginOptions WithUIAndChoice (
     IChoiceProvider<Account> accountChoiceProvider = null,
     Action<LoginProgress> reportProgress = null,
     Action<UIViewController, bool, NSAction> presentAuthController = null)
 {
     return new LoginOptions {
         AllowLoginUI = true,
         AccountChoiceProvider = accountChoiceProvider,
         PresentAuthController = presentAuthController,
         ReportProgress = reportProgress
     };
 }
Exemple #12
0
 public static LoginOptions WithUIAndChoice(
     IChoiceProvider <Account> accountChoiceProvider = null,
     Action <LoginProgress> reportProgress           = null,
     Action <UIViewController, bool, NSAction> presentAuthController = null)
 {
     return(new LoginOptions {
         AllowLoginUI = true,
         AccountChoiceProvider = accountChoiceProvider,
         PresentAuthController = presentAuthController,
         ReportProgress = reportProgress
     });
 }
        public IEnumerable <Feature> CollectOnUse(int level, IChoiceProvider choiceProvider, bool attuned, OGLContext context)
        {
            List <Feature> res = new List <Feature>();

            foreach (Feature f in OnUseFeatures)
            {
                f.Source = Source;
                res.AddRange(f.Collect(level, choiceProvider, context));
            }
            if (attuned)
            {
                foreach (Feature f in AttunedOnUseFeatures)
                {
                    f.Source = Source;
                    res.AddRange(f.Collect(level, choiceProvider, context));
                }
            }
            return(res);
        }
        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);
        }
        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);
        }
        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
            };

            if (Condition != null && Condition.Length > 0 && !choiceProvider.Matches(Condition, null, level))
            {
                return(res);
            }
            foreach (Feature f in Features)
            {
                res.AddRange(f.Collect(level, choiceProvider, context));
            }
            return(res);
        }
Exemple #17
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);
        }
 public List <Feature> FilterBackgroundFeatures(Background b, List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
 {
     return(ScanReplace(features, background));
 }
 public List <Feature> FilterSubRaceFeatures(SubRace sr, Race race, List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
 {
     return(ScanReplace(features, subrace));
 }
Exemple #20
0
 public List <Feature> FilterBackgroundFeatures(Background background, List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
 {
     return(features);
 }
        public List <Feature> FilterRaceFeatures(Race r, List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
        {
            List <Feature> res = ScanReplace(features, race);

            if (Context.LanguagesSimple.ContainsKey("Common"))
            {
                res.Add(new LanguageProficiencyFeature("", "", Context.LanguagesSimple["Common"], 0, true));
            }
            return(res);
        }
 public List <Feature> FilterSubClassFeatures(SubClass sc, ClassDefinition cls, int classlevel, List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
 {
     return(ScanReplace(features, subcls));
 }
 public List <Feature> FilterFeats(List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
 {
     return(ScanReplace(features, feat));
 }
 public List <Feature> FilterPossessionFeatures(List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
 {
     return(ScanReplace(features, possesion));
 }
Exemple #25
0
 public List <Feature> FilterClassFeatures(ClassDefinition cls, int classlevel, List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
 {
     if (cls != null && cls.MulticlassingSpellLevels != null && cls.MulticlassingSpellLevels.Count >= classlevel)
     {
         features.RemoveAll(f => f is SpellSlotsFeature);
         features.AddRange(GetFeature("CLS_" + cls.Name, cls.MulticlassingSpellLevels[classlevel - 1]));
     }
     else if (cls == null)
     {
         features.AddRange(GetFeature("MULTICLASSING", classlevel));
     }
     return(features);
 }
 public virtual IEnumerable <Item> getItems(IChoiceProvider provider, OGLContext context)
 {
     return(from i in Items select context.GetItem(i, Source));
 }
Exemple #27
0
 public List <Feature> FilterCommonFeatures(List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
 {
     return(features);
 }
Exemple #28
0
 public List <Feature> FilterRaceFeatures(Race race, List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
 {
     return(features);
 }
Exemple #29
0
 public List <Feature> FilterSubClassFeatures(SubClass sc, ClassDefinition cls, int classlevel, List <Feature> features, int level, IChoiceProvider provider, OGLContext Context)
 {
     if (sc != null && sc.MulticlassingSpellLevels != null && sc.MulticlassingSpellLevels.Count >= classlevel)
     {
         features.RemoveAll(f => f is SpellSlotsFeature);
         features.AddRange(GetFeature("SUB_" + sc.Name, sc.MulticlassingSpellLevels[classlevel - 1]));
     }
     return(features);
 }
 public ChooseTextViewModel(IChoiceProvider choiceProvider, IFileProcessor fileProcessor)
 {
     _choiceProvider = choiceProvider;
     _fileProcessor  = fileProcessor;
     AllowSetup      = Control.ModifierKeys == Keys.Shift;
 }
 public List <Feature> FilterSubClassFeatures(SubClass subcls, ClassDefinition cls, int classlevel, List <Feature> features, int level, IChoiceProvider provider, OGLContext context)
 {
     foreach (IPlugin i in plugins)
     {
         try
         {
             features = i.FilterSubClassFeatures(subcls, cls, classlevel, features, level, provider, context);
         }
         catch (Exception e)
         {
             ConfigManager.LogError("Error in Plugin " + i.Name, e);
         }
     }
     return(features);
 }