예제 #1
0
        public static GodEnum GetGodEnumBySubRegion(WorldSubRegion subRegion)
        {
            GodEnum ret = GodEnum.None;

            switch (subRegion)
            {
            case WorldSubRegion.AncientLibrary:
            case WorldSubRegion.TempleOfDarkness:
                ret = GodEnum.IntellectGod;
                break;

            case WorldSubRegion.TavernOfHeroes:
            case WorldSubRegion.CliffsOfAThousandPushups:
                ret = GodEnum.StrengthGod;
                break;

            case WorldSubRegion.DesertCrypt:
            case WorldSubRegion.VillageCenter:
                ret = GodEnum.TricksterGod;
                break;

            case WorldSubRegion.Oasis:
                ret = GodEnum.MercyGod;
                break;

            case WorldSubRegion.BeastTemple:
                ret = GodEnum.BeastGod;
                break;
            }

            return(ret);
        }
예제 #2
0
        public void PickNextAreaMethod_CorrectGodRelationshipBonusesAssigned_DesertGroupings(
            [Values(1, 2)] int whichPlayerGetsFlag, [Range(1, 4)] int firstMenuSelection, [Range(1, 4)] int secondMenuSelection)
        {
            MapGrouping <SubRegion, WorldSubRegion> firstGrouping, secondGrouping;
            MockMenu menu1, menu2;

            List <WorldSubRegion> firstGroupingSubRegions =
                WorldSubRegions.GetSubRegionsByGroupingId(Globals.GroupingKeys.FirstDesertGroupingId).ToList();
            List <WorldSubRegion> secondGroupingSubRegions =
                WorldSubRegions.GetSubRegionsByGroupingId(Globals.GroupingKeys.SecondDesertGroupingId).ToList();

            WorldSubRegion firstSubRegion  = firstGroupingSubRegions[firstMenuSelection - 1];
            WorldSubRegion secondSubRegion = secondGroupingSubRegions[secondMenuSelection - 1];

            PickNextArea_GroupingSetup_DesertGroupings(out firstGrouping, out secondGrouping);
            PickNextArea_MenuSetup_DesertGroupings(firstSubRegion, secondSubRegion, out menu1, out menu2);
            Team team = PickNextArea_TeamSetup_DesertGroupings(whichPlayerGetsFlag, "Stan", "Bill");

            List <HumanFighter> humanFighters = team.Fighters.OfType <HumanFighter>().ToList();

            HumanFighter mazeSolverFighter    = humanFighters.First(f => f.PersonalityFlags.Contains(PersonalityFlag.MazeSolver));
            HumanFighter notMazeSolverFighter = humanFighters.First(f => !f.PersonalityFlags.Contains(PersonalityFlag.MazeSolver));

            menu1.SetNextSelection(new TypedMenuSelection <WorldSubRegion>(firstSubRegion, "", null, null));
            menu2.SetNextSelection(new TypedMenuSelection <WorldSubRegion>(secondSubRegion, "", null, null));

            //Act
            _decisionManager.PickNextArea(firstGrouping, team);

            List <GodEnum> allGodEnums = EnumHelperMethods.GetAllValuesForEnum <GodEnum>().ToList();

            GodEnum mazeSolverSelectedRelationship = WorldSubRegions.GetGodEnumBySubRegion(firstSubRegion);

            Assert.AreEqual(1, _relationshipManager.GetFighterRelationshipValue(mazeSolverFighter, mazeSolverSelectedRelationship));

            IEnumerable <GodEnum> notSelectedGods = allGodEnums.Where(g => g != mazeSolverSelectedRelationship);

            foreach (GodEnum notSelectedGod in notSelectedGods)
            {
                int relationshipValue = _relationshipManager.GetFighterRelationshipValue(mazeSolverFighter, notSelectedGod);
                Assert.AreEqual(0, relationshipValue, $"fighter {mazeSolverFighter.DisplayName} should not have any points assigned to {notSelectedGod}");
            }


            GodEnum notMazeSolverSelectedRelationship = WorldSubRegions.GetGodEnumBySubRegion(secondSubRegion);

            Assert.AreEqual(1, _relationshipManager.GetFighterRelationshipValue(notMazeSolverFighter, notMazeSolverSelectedRelationship));

            notSelectedGods = allGodEnums.Where(g => g != notMazeSolverSelectedRelationship);
            foreach (GodEnum notSelectedGod in notSelectedGods)
            {
                int relationshipValue = _relationshipManager.GetFighterRelationshipValue(notMazeSolverFighter, notSelectedGod);
                Assert.AreEqual(0, relationshipValue, $"fighter {notMazeSolverFighter.DisplayName} should not have any points assigned to {notSelectedGod}");
            }
        }
예제 #3
0
 public GodDecisionBonus(int bonusAmount, GodEnum god) : base(bonusAmount)
 {
     _god = god;
 }
        public void UpdateRelationship(HumanFighter fighter, GodEnum god, int value)
        {
            FighterGodRelationship relationship = GetRelationship(fighter);

            relationship.UpdateRelationshipValue(god, value);
        }
        public int GetFighterRelationshipValue(HumanFighter fighter, GodEnum god)
        {
            FighterGodRelationship relationship = GetRelationship(fighter);

            return(relationship.GetRelationshipValue(god));
        }
 public void UpdateRelationshipValue(GodEnum god, int value)
 {
     _values[god] += value;
 }
 public int GetRelationshipValue(GodEnum god)
 {
     return(_values[god]);
 }
예제 #8
0
        public void UpdateRelationshipMethod_CorrectlyUpdatesRelationship([Values(1, 3)] int incrementValue, [Values(GodEnum.IntellectGod, GodEnum.MalevolentGod)] GodEnum god)
        {
            _relationshipManager.UpdateRelationship(_fighter, god, incrementValue);

            int updatedValue = _relationshipManager.GetFighterRelationshipValue(_fighter, god);

            Assert.AreEqual(incrementValue, updatedValue);
        }