Exemple #1
0
        public override string DrawEnemiesAndBullets(IEnemyCollection enemies, IList <Bullet> spaceshipBullets)
        {
            FileLogger.Log("Alien Template method pattern: drawing enemies");

            var builder = new StringBuilder();

            var skip = false;

            for (var column = 0; column < Contracts.GameSizeHeight; column++)
            {
                if (skip)
                {
                    builder.AppendLine();
                    skip = false;
                }
                else
                {
                    for (var row = 0; row < Contracts.GameSizeWidth; row++)
                    {
                        var contains = enemies.Count(x => x.Position.From.X < row && row <= x.Position.To.X) != 0;
                        builder.Append(contains ? "\u2021" : " ");
                    }
                    skip = true;
                }

                if (!skip)
                {
                    skip = enemies.Count(x => x.Position.From.Y < column && column <= x.Position.To.Y) == 0;
                }
            }
            return(builder.ToString());
        }
Exemple #2
0
 public SparsityMode(IRandomizerAgent agent, IAreaCollection areaCollection, IEnemyCollection enemyCollection, IItemCollection itemCollection, IItemTierList itemTierList)
 {
     Agent           = agent;
     AreaCollection  = areaCollection;
     EnemyCollection = enemyCollection;
     ItemCollection  = itemCollection;
     ItemTierList    = itemTierList;
 }
Exemple #3
0
 public GameBoard(SpaceShip spaceShip, EnemyVisitorBase visitor, DrawTemplateBase drawTemplateBase)
 {
     _spaceShip        = spaceShip;
     _visitor          = visitor;
     _drawTemplateBase = drawTemplateBase;
     _enemies          = new EnemyCollection();
     _iterator         = _enemies.CreateIterator();
 }
 public ThreeOrbMode(IRandomizerAgent randomizerAgent, IBossOrbTierList bossOrbTierList, IEnemyCollection enemyCollection, IItemTierList itemTierList, IItemCollection itemCollection, IAreaCollection areaCollection)
 {
     Agent           = randomizerAgent;
     BossOrbTierList = bossOrbTierList;
     EnemyCollection = enemyCollection;
     ItemTierList    = itemTierList;
     ItemCollection  = itemCollection;
     AreaCollection  = areaCollection;
 }
Exemple #5
0
        public string DrawGameObjects(IEnemyCollection enemies, SpaceShip spaceship)
        {
            FileLogger.Log("Base Template mehtod pattern: drawing all objects");

            var builder = new StringBuilder();

            builder.Append(DrawEnemiesAndBullets(enemies, spaceship.Bullets));
            builder.Append(DrawSpaceship(spaceship));
            return(builder.ToString());
        }
 public EnemyRandomizer(IRandomizerAgent agent, IEnemyCollection enemyCollection, IItemCollection itemCollection, IAttackTierList attackTierList,
                        IItemTierList itemTierList, IEnemyTierList enemyTierList, IElementRandomizer elementRandomizer, IItemRandomizer itemRandomizer)
 {
     Agent             = agent;
     EnemyCollection   = enemyCollection;
     ItemCollection    = itemCollection;
     AttackTierList    = attackTierList;
     ItemTierList      = itemTierList;
     EnemyTierList     = enemyTierList;
     ElementRandomizer = elementRandomizer;
     ItemRandomizer    = itemRandomizer;
 }
Exemple #7
0
 public AnalysisMode(IAttackCollection attackCollection,
                     IArmCollection armCollection,
                     IFastDrawCollection fastDrawCollection,
                     ISpellCollection spellCollection,
                     ISummonCollection summonCollection,
                     IEnemyCollection enemyCollection,
                     IItemCollection itemCollection,
                     IAreaCollection areaCollection,
                     IRandomizerAgent agent,
                     IEventParser eventParser)
 {
     AttackCollection   = attackCollection;
     ArmCollection      = armCollection;
     FastDrawCollection = fastDrawCollection;
     SpellCollection    = spellCollection;
     SummonCollection   = summonCollection;
     EnemyCollection    = enemyCollection;
     ItemCollection     = itemCollection;
     AreaCollection     = areaCollection;
     Agent       = agent;
     EventParser = eventParser;
 }
Exemple #8
0
        public override string DrawEnemiesAndBullets(IEnemyCollection enemies, IList <Bullet> spaceshipBullets)
        {
            FileLogger.Log("Simple Template method pattern: drawing enemies");

            var builder = new StringBuilder();

            for (var column = 0; column < Contracts.GameSizeHeight; column++)
            {
                for (var row = 0; row < Contracts.GameSizeWidth; row++)
                {
                    var containsEnemy = enemies.Count(
                        x => x.Position.From.X < row &&
                        row <= x.Position.To.X &&
                        column == x.Position.From.Y) != 0;

                    var containsBullet = spaceshipBullets.Count(
                        x => x.Position.X == row &&
                        x.Position.Y == column) != 0;

                    if (containsEnemy)
                    {
                        builder.Append("\u2302");
                    }
                    else if (containsBullet)
                    {
                        builder.Append("|");
                    }
                    else
                    {
                        builder.Append(" ");
                    }
                }
                builder.AppendLine();
            }
            return(builder.ToString());
        }
Exemple #9
0
 public RandomizerManager(IAttackCollection attackCollection,
                          IArmCollection armCollection,
                          IFastDrawCollection fastDrawCollection,
                          ISpellCollection spellCollection,
                          ISummonCollection summonCollection,
                          IEnemyCollection enemyCollection,
                          IItemCollection itemCollection,
                          IAreaCollection areaCollection,
                          ISparsityMode sparsityMode,
                          IThreeOrbMode threeOrbMode,
                          IAnalysisMode analysisMode,
                          IAlwaysRunOption alwaysRunOption,
                          IBossRebalancerOption bossRebalancerOption,
                          ICeciliaSpellsOption ceciliaSpellsOption,
                          IEventReducerOption eventReducerOption,
                          IExperienceFlattenerOption experienceFlattenerOption,
                          IItemPriceCorrectionOption itemPriceCorrectionOption,
                          ISwitchAnywhereOption switchAnywhereOption,
                          IUberBelselkOption uberBelselkOption,
                          IVehiclesAvailableOption vehiclesAvailableOption,
                          ISoloFightBufferOption soloFightBufferOption,
                          IAreaRandomizer areaRandomizer,
                          IArmRandomizer armRandomizer,
                          IAttackRandomizer attackRandomizer,
                          IEnemyRandomizer enemyRandomizer,
                          IFastDrawRandomizer fastDrawRandomizer,
                          IItemRandomizer itemRandomizer,
                          ISpellRandomizer spellRandomizer,
                          ISummonRandomizer summonRandomizer,
                          IRandomizerAgent agent)
 {
     AttackCollection          = attackCollection;
     ArmCollection             = armCollection;
     FastDrawCollection        = fastDrawCollection;
     SpellCollection           = spellCollection;
     SummonCollection          = summonCollection;
     EnemyCollection           = enemyCollection;
     ItemCollection            = itemCollection;
     AreaCollection            = areaCollection;
     SparsityMode              = sparsityMode;
     ThreeOrbMode              = threeOrbMode;
     AnalysisMode              = analysisMode;
     AlwaysRunOption           = alwaysRunOption;
     BossRebalancerOption      = bossRebalancerOption;
     CeciliaSpellsOption       = ceciliaSpellsOption;
     ItemPriceCorrectionOption = itemPriceCorrectionOption;
     ExperienceFlattenerOption = experienceFlattenerOption;
     SwitchAnywhereOption      = switchAnywhereOption;
     VehiclesAvailableOption   = vehiclesAvailableOption;
     EventReducerOption        = eventReducerOption;
     UberBelselkOption         = uberBelselkOption;
     SoloFightBufferOption     = soloFightBufferOption;
     AreaRandomizer            = areaRandomizer;
     ArmRandomizer             = armRandomizer;
     AttackRandomizer          = attackRandomizer;
     EnemyRandomizer           = enemyRandomizer;
     FastDrawRandomizer        = fastDrawRandomizer;
     ItemRandomizer            = itemRandomizer;
     SpellRandomizer           = spellRandomizer;
     SummonRandomizer          = summonRandomizer;
     Agent = agent;
 }
Exemple #10
0
 public abstract string DrawEnemiesAndBullets(IEnemyCollection enemies, IList <Bullet> spaceshipBullets);
Exemple #11
0
        public EnemyIterator(IEnemyCollection collection)
        {
            FileLogger.Log("Concrete Iterator: created");

            _collection = collection;
        }
Exemple #12
0
 public SoloFightBufferOption(IRandomizerAgent agent, IEnemyCollection enemyCollection)
 {
     Agent           = agent;
     EnemyCollection = enemyCollection;
 }
Exemple #13
0
 public ExperienceFlattenerOption(IRandomizerAgent agent, IEnemyCollection enemyCollection)
 {
     Agent           = agent;
     EnemyCollection = enemyCollection;
 }
Exemple #14
0
 public BossRebalancerOption(IRandomizerAgent agent, IEnemyCollection enemyCollection, IEnemyTierList enemyTierList)
 {
     Agent           = agent;
     EnemyCollection = enemyCollection;
     EnemyTierList   = enemyTierList;
 }
Exemple #15
0
 public UberBelselkOption(IRandomizerAgent randomizerAgent, IEnemyCollection enemyCollection)
 {
     Agent           = randomizerAgent;
     EnemyCollection = enemyCollection;
 }