public override void CalculatePoints(IScoringMethod scoringMethod)
 {
     ProjectedPoints = CalculateReceivingPoints(scoringMethod, RecTds, RecYds, RecAtt) + Fumbles * scoringMethod.FumbleLost;
     HighProjectedPoints = CalculateReceivingPoints(scoringMethod, RecTdsHigh, RecYdsHigh, RecAttHigh) + FumblesHigh * scoringMethod.FumbleLost; ;
     LowProjectedPoints = CalculateReceivingPoints(scoringMethod, RecTdsLow, RecYdsLow, RecAttLow) + FumblesLow * scoringMethod.FumbleLost; ;
 }
Пример #2
0
            public CasteFilter(CasteOptions options)
            {
                mPriority = options.GetValue <CastePriorityOption, int>();

                mAutomatic = options.GetValue <CasteAutoOption, bool>();

                foreach (CASAgeGenderFlags flag in options.GetValue <CasteAgeOption, List <CASAgeGenderFlags> >())
                {
                    mAgeGender |= flag;
                }

                foreach (CASAgeGenderFlags flag in options.GetValue <CasteGenderOption, List <CASAgeGenderFlags> >())
                {
                    mAgeGender |= flag;
                }

                mSpecies = new Dictionary <CASAgeGenderFlags, bool>();

                foreach (CASAgeGenderFlags flag in options.GetValue <CasteSpeciesOption, List <CASAgeGenderFlags> >())
                {
                    mSpecies.Add(flag, true);
                }

                mTypes = new List <SimType>(options.GetValue <CasteTypeOption, List <SimType> >());

                mMatchAll = options.GetValue <CasteMatchAllTypeOption, bool>();

                mMinNetWorth = options.GetValue <CasteFundsMinOption, int>();
                mMaxNetWorth = options.GetValue <CasteFundsMaxOption, int>();

                string scoring = options.GetValue <CasteScoringOption, string>();

                if (!string.IsNullOrEmpty(scoring))
                {
                    mScoring = ScoringLookup.GetScoring(scoring) as IScoringMethod <SimDescription, SimScoringParameters>;
                }

                mPersonalityLeaders = new Dictionary <string, bool>();

                foreach (string personality in options.GetValue <CastePersonalityLeaderOption, List <string> >())
                {
                    mPersonalityLeaders[personality] = true;
                }

                mPersonalityMembers = new Dictionary <string, bool>();

                foreach (string personality in options.GetValue <CastePersonalityMemberOption, List <string> >())
                {
                    mPersonalityMembers[personality] = true;
                }

                mRequiredTraits = new Dictionary <TraitNames, bool>();

                foreach (TraitNames trait in options.GetValue <CasteTraitRequireOption, List <TraitNames> >())
                {
                    mRequiredTraits[trait] = true;
                }

                mDeniedTraits = new Dictionary <TraitNames, bool>();

                foreach (TraitNames trait in options.GetValue <CasteTraitDenyOption, List <TraitNames> >())
                {
                    mDeniedTraits[trait] = true;
                }

                // I need to refactor this but she works for now
                mSkill = new List <SkillNames>();

                foreach (string skill in options.GetValue <CasteSkillFilterOption, List <string> >())
                {
                    // we aren't storing this as skillnames cause twallan didn't for some reason.
                    // I assume changing it will wipe existing DisallowSkill settings
                    SkillNames skillName;
                    if (ParserFunctions.TryParseEnum <SkillNames>(skill, out skillName, SkillNames.None))
                    {
                        mSkill.Add(skillName);
                    }
                }

                mSkillLevel = new Dictionary <SkillNames, List <int> >();
                foreach (string skillLevel in options.GetValue <CasteSkillLevelFilterOption, List <string> >())
                {
                    string[] split = skillLevel.Split('-');
                    if (split.Length == 2)
                    {
                        SkillNames skillName;
                        if (ParserFunctions.TryParseEnum <SkillNames>(split[0], out skillName, SkillNames.None))
                        {
                            if (!mSkillLevel.ContainsKey(skillName))
                            {
                                mSkillLevel.Add(skillName, new List <int>());
                            }

                            int result;
                            if (int.TryParse(split[1], out result))
                            {
                                if (skillName != SkillNames.None && result > 0)
                                {
                                    mSkillLevel[skillName].Add(result);
                                }
                            }
                        }
                    }
                }

                mCareer = new List <OccupationNames>();

                foreach (OccupationNames career in options.GetValue <CasteCareerFilterOption, List <OccupationNames> >())
                {
                    mCareer.Add(career);
                }

                mCareerLevel = new Dictionary <OccupationNames, List <int> >();

                foreach (string careerLevel in options.GetValue <CasteCareerLevelFilterOption, List <string> >())
                {
                    string[] split = careerLevel.Split('-');
                    if (split.Length == 2)
                    {
                        OccupationNames careerName;
                        if (ParserFunctions.TryParseEnum <OccupationNames>(split[0], out careerName, OccupationNames.Undefined))
                        {
                            if (!mCareerLevel.ContainsKey(careerName))
                            {
                                mCareerLevel.Add(careerName, new List <int>());
                            }

                            int result;
                            if (int.TryParse(split[1], out result))
                            {
                                if (careerName != OccupationNames.Undefined && result > 0)
                                {
                                    mCareerLevel[careerName].Add(result);
                                }
                            }
                        }
                    }
                }

                mZodiac = new List <Zodiac>();

                foreach (Zodiac zodiac in options.GetValue <CasteZodiacFilterOption, List <Zodiac> >())
                {
                    mZodiac.Add(zodiac);
                }

                mDegree = new List <AcademicDegreeNames>();

                foreach (AcademicDegreeNames degree in options.GetValue <CasteDegreeFilterOption, List <AcademicDegreeNames> >())
                {
                    mDegree.Add(degree);
                }
            }
 public override void CalculatePoints(IScoringMethod scoringMethod)
 {
     ProjectedPoints = CalculateFlexPoints(scoringMethod, RushTds, RushYds, RecTds, RecYds, RecAtt, Fumbles);
     HighProjectedPoints = CalculateFlexPoints(scoringMethod, RushTdsHigh, RushYdsHigh, RecTdsHigh, RecYdsHigh, RecAttHigh, FumblesHigh);
     LowProjectedPoints = CalculateFlexPoints(scoringMethod, RushTdsLow, RushYdsLow, RecTdsLow, RecYdsLow, RecAttLow, FumblesLow);
 }
 public override void CalculatePoints(IScoringMethod scoringMethod)
 {
     ProjectedPoints = CalculatePassingPoints(scoringMethod, PassTds, PassYds, PassInts, Fumbles) + CalculateRushingPoints(scoringMethod, RushTds, RushYds);
     HighProjectedPoints = CalculatePassingPoints(scoringMethod, PassTdsHigh, PassYdsHigh, PassIntsHigh, FumblesHigh) + CalculateRushingPoints(scoringMethod, RushTdsHigh, RushYdsHigh);
     LowProjectedPoints = CalculatePassingPoints(scoringMethod, PassTdsLow, PassYdsLow, PassIntsLow, FumblesLow) + CalculateRushingPoints(scoringMethod, RushTdsLow, RushYdsLow);
 }
 protected double CalculateRushingPoints(IScoringMethod scoringMethod, double rushTds, double rushYds)
 {
     double points = rushTds * scoringMethod.RushingTD;
     points += rushYds * scoringMethod.RushingYards;
     points += rushYds > 100 ? scoringMethod.OneHundredYardRushingGame : 0;
     return points;
 }
 protected double CalculateReceivingPoints(IScoringMethod scoringMethod, double recTds, double recYds, double recAtt)
 {
     double points = recTds * scoringMethod.ReceivingTD;
     points += recYds * scoringMethod.ReceivingYards;
     points += recYds > 100 ? scoringMethod.OneHundredYardReceivingGame : 0;
     points += recAtt * scoringMethod.Reception;
     return points;
 }
 protected double CalculatePassingPoints(IScoringMethod scoringMethod, double passTds, double passYds, double passInts, double fumbles)
 {
     double points = passTds * scoringMethod.PassingTD;
     points += passYds * scoringMethod.PassingYards;
     points += passYds > 300 ? scoringMethod.ThreeHundredYardPassingGame : 0;
     points += passInts * scoringMethod.Interception;
     points += fumbles * scoringMethod.FumbleLost;
     return points;
 }
 protected double CalculateFlexPoints(IScoringMethod scoringMethod, double rushTds, double rushYds, double recTds, double recYds, double recAtt, double fumbles)
 {
     double points = CalculateRushingPoints(scoringMethod, rushTds, rushYds);
     points += CalculateReceivingPoints(scoringMethod, recTds, recYds, recAtt);
     points += fumbles * scoringMethod.FumbleLost;
     return points;
 }
 public virtual void CalculatePoints(IScoringMethod scoringMethod)
 {
 }