Ejemplo n.º 1
0
        public BattleFieldInfo GetBattleFieldSetUp(BattlefieldConfiguration config)
        {
            Team generatedTeam = null;

            if (config.GroupingConfiguration != null)
            {
                FighterGrouping generatedGrouping = _groupingFactory.GetGrouping(config.GroupingConfiguration);
                generatedTeam = _teamFactory.GetTeam(generatedGrouping);
            }

            if (config.TeamConfiguration != null)
            {
                generatedTeam = _teamFactory.GetTeam(config.TeamConfiguration);
            }

            List <TerrainInteractable> terrainInteractables = new List <TerrainInteractable>();

            BellTerrainConfiguration bellConfiguration = config.TerrainConfiguration as BellTerrainConfiguration;

            if (bellConfiguration != null)
            {
                foreach (BellType bellType in bellConfiguration.BellTypes)
                {
                    terrainInteractables.Add(new Bell($"{bellType.ToString().ToLower()} bell", bellType, _menuFactory, _chanceService));
                }
            }

            BattleFieldInfo generatedBattlefieldInfo = new BattleFieldInfo(generatedTeam, terrainInteractables);

            return(generatedBattlefieldInfo);
        }
Ejemplo n.º 2
0
        public void Constructor_CorrectlyAllowsGroupingInput_AndSetsDisplayNames()
        {
            Goblin          goblin1  = (Goblin)FighterFactory.GetFighter(FighterType.Goblin, 1);
            Goblin          goblin2  = (Goblin)FighterFactory.GetFighter(FighterType.Goblin, 1);
            FighterGrouping grouping = new FighterGrouping(goblin1, goblin2);

            Team team = new Team(TestMenuManager.GetTestMenuManager(), grouping);

            Assert.AreEqual(2, team.Fighters.Count);

            Assert.True(team.Fighters.Contains(goblin1));
            Assert.True(team.Fighters.Contains(goblin2));
        }
Ejemplo n.º 3
0
        public Team GetTeam(FighterGrouping grouping)
        {
            List <IFighter> fighters = grouping.GetFighters();

            return(new Team(new MenuManager(new ConsoleInput(), new ConsoleOutput(), _menuFactory), fighters));
        }
Ejemplo n.º 4
0
 public Team GetTeam(FighterGrouping grouping)
 {
     return(_teams.Count > 0 ? _teams.Dequeue() : _realTeamFactory.GetTeam(grouping));
 }
Ejemplo n.º 5
0
 public Team(MenuManager menuManager, FighterGrouping grouping, params IFighter[] fighters) : this(menuManager, fighters.Concat(grouping.GetFighters()).ToArray())
 {
 }