public CrazySupply(IIntelManager intelManager, IProductionManager productionManager, ICombatManager combatManager, ISquadRepository squadRepository) { this.intelManager = intelManager; this.productionManager = productionManager; this.combatManager = combatManager; rep = squadRepository; }
public TechTree(IIntelManager intelManager, IUnitTypeRepository unitTypeRepository, IUpgradeRepository upgradeRepository, Essence essence) { this.intelManager = intelManager; this.unitTypeRepository = unitTypeRepository; this.upgradeRepository = upgradeRepository; Initialize(essence); }
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; }
public ProtossDemo(IIntelManager intelManager, ICombatManager combatManager, IProductionManager productionManager, ISquadRepository squadRepo) { _intelManager = intelManager; _combatManager = combatManager; _productionManager = productionManager; _squadRep = squadRepo; }
// 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; }
// 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; }
public LazyDeveloperDemo(IProductionManager productionManager, ISquadRepository squadRepo, IIntelManager intel, ICombatManager combatManager, ILogger log) { _productionManager = productionManager; _squadRepo = squadRepo; _intel = intel; _combatManger = combatManager; _log = log; }
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; }
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; }
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; }
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; }
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 }; }
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)); }
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..."); }); }
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); }
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" }; }
/// 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; }
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); }
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(); }
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("]"); }
public Debug(IProductionManager productionManager, IIntelManager intelManager, ILogger logger) { this.productionManager = productionManager; this.intelManager = intelManager; this.log = logger; }
public MapRenderDemo(IIntelManager intel, GameSettings gameSettings, IAbathur abathur) { _intel = intel; _gameSettings = gameSettings; _abathur = abathur; }
public AutoExpand(IIntelManager intel, ISquadRepository squadRepository, IProductionManager productionManager) { _intel = intel; _squadRepository = squadRepository; _productionManager = productionManager; }
public static List <IUnit> CompletedStructuresSelf(IIntelManager intelManager, params uint[] types) { var structsSelf = intelManager.StructuresSelf(types).ToList(); return(intelManager.StructuresSelf(types).Where(BuildCompleted).ToList()); }
public CombatManagerService(IIntelManager intel, ICombatManager manager, ISquadRepository repository) { _intel = intel; _manager = manager; _repository = repository; }
public AutoHarvestGather(IIntelManager intelManager, IRawManager rawManager) { this.intelManager = intelManager; this.rawManager = rawManager; }
public AutoSupply(IIntelManager intelManager, IProductionManager productionManager) { this.intelManager = intelManager; this.productionManager = productionManager; }
public AutoPush(IIntelManager intel, ICombatManager combat, ISquadRepository squadRepository) { _intel = intel; _combat = combat; _squadRepository = squadRepository; }
public AutoQueenInject(IIntelManager intel, ISquadRepository squadRepo, ICombatManager combatManager) { _intel = intel; _squadRepo = squadRepo; _combatManager = combatManager; }