Пример #1
0
 public CrazySupply(IIntelManager intelManager, IProductionManager productionManager, ICombatManager combatManager, ISquadRepository squadRepository)
 {
     this.intelManager      = intelManager;
     this.productionManager = productionManager;
     this.combatManager     = combatManager;
     rep = squadRepository;
 }
Пример #2
0
 public TechTree(IIntelManager intelManager, IUnitTypeRepository unitTypeRepository, IUpgradeRepository upgradeRepository, Essence essence)
 {
     this.intelManager       = intelManager;
     this.unitTypeRepository = unitTypeRepository;
     this.upgradeRepository  = upgradeRepository;
     Initialize(essence);
 }
Пример #3
0
        public static bool BaseUnderAttack(IIntelManager intelManager)
        {
            var ownColonies = Helpers.GetOwnColonies(intelManager);
            var enemyUnits  = intelManager.UnitsEnemyVisible.ToList();

            return(ownColonies.Any(col => enemyUnits.Any(u => u.Point.Distance(col.Point) < 15)));
        }
 public CombatManagerLiveTest(IIntelManager intelManager, ICombatManager combatManager, IProductionManager productionManager, ISquadRepository squadRepo)
 {
     _intelManager      = intelManager;
     _combatManager     = combatManager;
     _productionManager = productionManager;
     _squadRep          = squadRepo;
 }
Пример #5
0
 public ProtossDemo(IIntelManager intelManager, ICombatManager combatManager, IProductionManager productionManager, ISquadRepository squadRepo)
 {
     _intelManager      = intelManager;
     _combatManager     = combatManager;
     _productionManager = productionManager;
     _squadRep          = squadRepo;
 }
Пример #6
0
 // Everything inheriting from IReplaceableModule is added to the IOC and can be dependency injected.
 public RandomDemo(IAbathur abathur, IIntelManager intel, TerranDemo terranModule, ProtossDemo protossModule, ZergDemo zergModule)
 {
     _terranModule  = terranModule;
     _protossModule = protossModule;
     _zergModule    = zergModule;
     _abathur       = abathur;
     _intel         = intel;
 }
Пример #7
0
 // Take required managers in the constructor, see FullModule for all possible managers.
 public ZergDemo(IIntelManager intelManager, ICombatManager combatManager, IProductionManager productionManager, ISquadRepository squadRepo, GameSettings gamsettings)
 {
     _intelManager      = intelManager;
     _combatManager     = combatManager;
     _productionManager = productionManager;
     _squadRep          = squadRepo;
     _gameSettings      = gamsettings;
 }
Пример #8
0
 public LazyDeveloperDemo(IProductionManager productionManager, ISquadRepository squadRepo, IIntelManager intel, ICombatManager combatManager, ILogger log)
 {
     _productionManager = productionManager;
     _squadRepo         = squadRepo;
     _intel             = intel;
     _combatManger      = combatManager;
     _log = log;
 }
Пример #9
0
 public ProductionManager(IRawManager rawManager, IIntelManager intelManager, IUnitTypeRepository unitTypeRepository, ITechTree techTree, IUpgradeRepository upgradeRepository, ILogger logger)
 {
     this.rawManager         = rawManager;
     this.intelManager       = intelManager;
     this.unitTypeRepository = unitTypeRepository;
     this.techTree           = techTree;
     this.log = logger;
     this.upgradeRepository = upgradeRepository;
 }
Пример #10
0
 public AirModule(StateSnapshot snapshot,
                  IIntelManager intelManager, IProductionManager productionManager,
                  ICombatManager combatManager, ISquadRepository squadRepo)
 {
     this.snapshot          = snapshot;
     this.intelManager      = intelManager;
     this.productionManager = productionManager;
     this.combatManager     = combatManager;
     this.squadRepo         = squadRepo;
 }
Пример #11
0
 public AVStrategy(IAbathur abathur, IIntelManager intelManager, ICombatManager combatManager,
                   IProductionManager productionManager, ISquadRepository squadRepo, IRawManager rawManager)
 {
     this.abathur           = abathur;
     this.intelManager      = intelManager;
     this.combatManager     = combatManager;
     this.productionManager = productionManager;
     this.squadRepo         = squadRepo;
     this.rawManager        = rawManager;
 }
Пример #12
0
 public EconomyModule(StateSnapshot snapshot,
                      IIntelManager intelManager, IProductionManager productionManager,
                      ICombatManager combatManager, IRawManager rawManager)
 {
     this.state             = snapshot;
     this.intelManager      = intelManager;
     this.productionManager = productionManager;
     this.combatManager     = combatManager;
     this.rawManager        = rawManager;
 }
Пример #13
0
 public Abathur(ILogger logger, IIntelManager intelManager, ICombatManager combatManager,
                IProductionManager productionManager, IRawManager rawManager, GameSettings gameSettings)
 {
     this.rawManager = rawManager;
     this.log        = logger;
     Settings        = gameSettings;
     CoreModules     = new List <IModule> {
         intelManager,
         combatManager,
         productionManager
     };
 }
Пример #14
0
 public void Initialize(ResponseGameInfo info, IIntelManager intelManager)
 {
     PlacementGrid = MapHandler.Instantiate(info.StartRaw.PlacementGrid);
     NonPathable   = MapHandler.Instantiate(info.StartRaw.PathingGrid);
     TerrainHeight = MapHandler.Instantiate(info.StartRaw.TerrainHeight);
     BlockedGrid   = MapHandler.Instantiate(PlacementGrid.Width, PlacementGrid.Height);
     NaturalGrid   = MapHandler.Instantiate(PlacementGrid.Width, PlacementGrid.Height);
     Power         = MapHandler.Instantiate(PlacementGrid.Width, PlacementGrid.Height);
     Creep         = MapHandler.Instantiate(PlacementGrid.Width, PlacementGrid.Height);
     Explored      = MapHandler.Instantiate(PlacementGrid.Width, PlacementGrid.Height);
     intelManager.Handler.RegisterHandler(Case.StructureAddedSelf, u => EventUnitAdded(u));
     intelManager.Handler.RegisterHandler(Case.StructureDestroyed, u => EventUnitDestroyed(u));
 }
Пример #15
0
        private void RunMapAnalyzer(IIntelManager intelManager)
        {
            return; //TODO: ADD AGAIN

            var mapAna = new MapAnalyser();

            Task.Run(async() => {
                var sw = new Stopwatch();
                sw.Start();
                Graph   = await mapAna.CreateGraph(this);
                Regions = mapAna.GenerateRegions(intelManager.Colonies, Graph);
                sw.Stop();
                Console.WriteLine("MapAnalyser took: " + sw.Elapsed.Minutes + " mins and " + sw.Elapsed.Seconds + " seconds...");
            });
        }
Пример #16
0
        public static List <IColony> GetOwnColonies(IIntelManager intelManager)
        {
            var ownColonies    = new List <IColony>();
            var commandCenters = intelManager.StructuresSelf()
                                 .Where(u => GameConstants.IsHeadquarter(u.UnitType))
                                 .Where(u => u.BuildProgress > 0.98)
                                 .ToList();

            foreach (var colony in intelManager.Colonies)
            {
                if (commandCenters.Any(cc => colony.Structures.Contains(cc)))
                {
                    ownColonies.Add(colony);
                }
            }
            return(ownColonies);
        }
Пример #17
0
 public AutoMapRotation(IRawManager rawManager, ILogger logger, GameSettings settings, IAbathur abathur, IIntelManager intelManager)
 {
     this.abathur      = abathur;
     this.rawManager   = rawManager;
     this.settings     = settings;
     this.intelManager = intelManager;
     this.log          = logger;
     maps = new List <string> {
         "Flooded City",
         "Deadlock Ridge",
         "Antiga Shipyard",
         "Arctic Gates",
         "Cinder Fortress",
         "Condemned Ridge",
         "Daybreak LE",
         "Desolate Stronghold",
         "Dig Site",
         "District 10",
         "Eastwatch LE",
         "Entombed Valley",
         "Forgotten Sanctuary",
         "Green Acres",
         "Last Remnant",
         "Lava Flow",
         "Lunar Colony V",
         "Magma Core",
         "Megaton",
         "Molten Crater",
         "Ohana LE",
         "Old Estate",
         "Outpost",
         "Overgrown Facility",
         "Sand Canyon",
         "Seeds of Aiur",
         "Silent Dunes",
         "Snowy Mesa",
         "Temple of the Preservers",
         "The Bio Lab",
         "The Boneyard",
         "The Ruins of Tarsonis",
         "Traitor's Exile",
         "Tropic Shores",
         "Tyrador Keep",
         "Cloud Kingdom LE"
     };
 }
Пример #18
0
 /// IModules can take any number of these in the constructor and in any order.
 /// It is all handled using Dependency Injection.
 public FullModule(ILogger log, IIntelManager intelManager, ICombatManager combatManager,
                   IProductionManager productionManager, IRawManager rawManager, IAbilityRepository abilityRepository,
                   IUnitTypeRepository unitTypeRepository, IUpgradeRepository upgradeRepository, IBuffRepository buffRepository,
                   ISquadRepository squadRepository, IGameMap gameMap, ITechTree techTree, GameSettings gameSettings)
 {
     this.log                = log;
     this.intelManager       = intelManager;
     this.combatManager      = combatManager;
     this.productionManager  = productionManager;
     this.rawManager         = rawManager;
     this.abilityRepository  = abilityRepository;
     this.unitTypeRepository = unitTypeRepository;
     this.upgradeRepository  = upgradeRepository;
     this.buffRepository     = buffRepository;
     this.squadRepository    = squadRepository;
     this.gameMap            = gameMap;
     this.techTree           = techTree;
 }
Пример #19
0
        internal static List <IColony> GetEnemyColonies(IIntelManager intelManager)
        {
            var enemyColonies  = new List <IColony>();
            var commandCenters = intelManager.StructuresEnemy()
                                 .Where(u => GameConstants.IsHeadquarter(u.UnitType)).ToList();

            foreach (var colony in intelManager.Colonies)
            {
                if (commandCenters.Any(cc => colony.Structures.Contains(cc)))
                {
                    enemyColonies.Add(colony);
                }
            }

            // Add their starting location
            enemyColonies.Add(intelManager.Colonies.First(c => c.IsStartingLocation));
            return(enemyColonies);
        }
Пример #20
0
        public void UpdateState(IIntelManager intelManager)
        {
            OwnColonies   = Helpers.GetOwnColonies(intelManager);
            EnemyColonies = Helpers.GetEnemyColonies(intelManager);

            BaseThreats = new Dictionary <IColony, List <IUnit> >();
            var enemyUnits = intelManager.UnitsEnemyVisible.ToList();

            foreach (var col in OwnColonies)
            {
                BaseThreats[col] = enemyUnits.Where(u => u.Point.Distance(col.Point) < 20).ToList();
            }

            RemainingSupply = intelManager.Common.FoodCap - intelManager.Common.FoodUsed;

            var minStructures = OwnColonies.Min(c => c.Structures.Count());

            LeastExpandedColony = OwnColonies.Where(c => c.Structures.Count() == minStructures).FirstOrDefault();
        }
Пример #21
0
        public static void PrintProductionQueue(IIntelManager intelManager)
        {
            var unitIds = intelManager.ProductionQueue.Select(u => u.UnitId).ToList();

            BuildUnitIdToNameDict();

            Console.WriteLine("Queue: [");
            foreach (var id in unitIds)
            {
                if (UnitIdToName.ContainsKey(id))
                {
                    Console.WriteLine($"   {UnitIdToName[id]}");
                }
                else
                {
                    Console.WriteLine("   <non-unit>");
                }
            }
            Console.WriteLine("]");
        }
Пример #22
0
 public Debug(IProductionManager productionManager, IIntelManager intelManager, ILogger logger)
 {
     this.productionManager = productionManager;
     this.intelManager      = intelManager;
     this.log = logger;
 }
Пример #23
0
 public MapRenderDemo(IIntelManager intel, GameSettings gameSettings, IAbathur abathur)
 {
     _intel        = intel;
     _gameSettings = gameSettings;
     _abathur      = abathur;
 }
Пример #24
0
 public AutoExpand(IIntelManager intel, ISquadRepository squadRepository, IProductionManager productionManager)
 {
     _intel             = intel;
     _squadRepository   = squadRepository;
     _productionManager = productionManager;
 }
Пример #25
0
        public static List <IUnit> CompletedStructuresSelf(IIntelManager intelManager, params uint[] types)
        {
            var structsSelf = intelManager.StructuresSelf(types).ToList();

            return(intelManager.StructuresSelf(types).Where(BuildCompleted).ToList());
        }
Пример #26
0
 public CombatManagerService(IIntelManager intel, ICombatManager manager, ISquadRepository repository)
 {
     _intel      = intel;
     _manager    = manager;
     _repository = repository;
 }
Пример #27
0
 public AutoHarvestGather(IIntelManager intelManager, IRawManager rawManager)
 {
     this.intelManager = intelManager;
     this.rawManager   = rawManager;
 }
Пример #28
0
 public AutoSupply(IIntelManager intelManager, IProductionManager productionManager)
 {
     this.intelManager      = intelManager;
     this.productionManager = productionManager;
 }
Пример #29
0
 public AutoPush(IIntelManager intel, ICombatManager combat, ISquadRepository squadRepository)
 {
     _intel           = intel;
     _combat          = combat;
     _squadRepository = squadRepository;
 }
Пример #30
0
 public AutoQueenInject(IIntelManager intel, ISquadRepository squadRepo, ICombatManager combatManager)
 {
     _intel         = intel;
     _squadRepo     = squadRepo;
     _combatManager = combatManager;
 }