Пример #1
0
        public BattleFieldInfo GetBattleFieldInfo(SubRegion region, int round)
        {
            BattleFieldInfo generatedBattleFieldInfo = null;

            if (round < region.NumberRegularBattles)
            {
                BattlefieldConfiguration battlefieldConfig =
                    region.ScriptedBattlefieldConfigurations.FirstOrDefault(script => script.BattleIndex == round)?
                    .BattlefieldConfig;

                if (battlefieldConfig == null)
                {
                    Team generatedTeam = _teamFactory.GetTeam(region);
                    generatedBattleFieldInfo = new BattleFieldInfo(generatedTeam, new List <TerrainInteractable>());
                }
                else
                {
                    generatedBattleFieldInfo = _battlefieldFactory.GetBattleFieldSetUp(battlefieldConfig);
                }
            }
            else
            {
                generatedBattleFieldInfo = _battlefieldFactory.GetBattleFieldSetUp(region.BossConfiguration);
            }

            return(generatedBattleFieldInfo);
        }
        public void CorrectlyGeneratesEmptyListOfTerrainInteractables_FromNullInput()
        {
            TeamConfiguration        teamInfo          = new TeamConfiguration(new EnemyConfiguration(FighterType.Goblin, 1), new EnemyConfiguration(FighterType.Fairy, 1));
            BattlefieldConfiguration battlefieldConfig = new BattlefieldConfiguration(teamInfo);

            BattleFieldInfo returnedBattleFieldInfo = _factory.GetBattleFieldSetUp(battlefieldConfig);

            Assert.NotNull(returnedBattleFieldInfo.TerrainInteractables);
            Assert.AreEqual(0, returnedBattleFieldInfo.TerrainInteractables.ToList().Count);
        }