public SettingsController( MathSiteDbContext context, MathServices services, IMapper mapper ) : base(context, services, mapper) { }
public void OnStep() { if (_scouting) { foreach (var unit in _intel.UnitsEnemyVisible.Where(u => u.UnitType != BlizzardConstants.Unit.Overlord || u.UnitType != BlizzardConstants.Unit.Overseer || u.UnitType != BlizzardConstants.Unit.OverlordTransport)) { if (MathServices.EuclidianDistance(unit, _scout) < 10) { _combat.Move(_scout.Tag, GetFleePoint(_scout.Point, unit.Point)); _scouting = false; } } } if (!_scouting) { var sortedColonies = _intel.Colonies.OrderBy(c => MathServices.EuclidianDistance(c.Point, _eStart)); foreach (var colony in sortedColonies) { _combat.Move(_scout.Tag, colony.Point, true); } _scouting = true; } if (_scout.Orders.Count == 0) { _scouting = false; } }
public AuthController( MathSiteDbContext context, MathServices services, IOptions <ExtendedAuthData> authOptions ) : base(context, services) { _authData = authOptions.Value; }
public DirectoriesController( MathSiteDbContext context, MathServices services, IMapper mapper, CrudServiceMethods <Directory, DirectoryDto> crudServiceMethods ) : base(context, services, mapper) { _crudServiceMethods = crudServiceMethods; }
public void OnStep() { // Wait for the queued units to finish if (!_done && !_intelManager.ProductionQueue.Any()) { foreach (var colony in _eStarts) // Then queue attack move command on each enemy starting location { _combatManager.AttackMove(theGang, colony.Point, true); } _done = true; // Check to make sure we only do it once } if (_done) // Once the attack has begun { foreach (var gangUnit in theGang.Units) { // Find the enemys closest base using straight line distance var point = _eStarts.OrderBy(c => MathServices.EuclidianDistance(gangUnit.Point, c.Point)).First().Point; // Ïf the adepts are close enough to phase walk to the middle of the base, do it. if (gangUnit.UnitType == BlizzardConstants.Unit.Adept) { if (MathServices.EuclidianDistance(gangUnit.Point, point) < 35 && MathServices.EuclidianDistance(gangUnit.Point, point) > 5) { _combatManager.UsePointCenteredAbility(BlizzardConstants.Ability.AdeptPhaseShift, gangUnit.Tag, point); } } else if (gangUnit.UnitType == BlizzardConstants.Unit.Phoenix && !_intelManager.UnitsEnemyVisible.Any(u => u.BuffIds.Contains(BlizzardConstants.Buffs.GravitonBeam))) { // If there is not already an enemy affected by gravition beam, then find a visible unit var eUnit = _intelManager.UnitsEnemyVisible.FirstOrDefault(); if (eUnit != null) { // and use Gravition beam on it _combatManager.UseTargetedAbility(BlizzardConstants.Ability.GravitonBeam, gangUnit.Tag, eUnit.Tag); } } else if (gangUnit.UnitType == BlizzardConstants.Unit.Sentry) { // If there are any visible enemies close if (_intelManager.UnitsEnemyVisible.Any(e => MathServices.EuclidianDistance(e.Point, gangUnit.Point) < 15)) { // Use guardian shield _combatManager.UseTargetlessAbility(BlizzardConstants.Ability.GuardianShield, gangUnit.Tag); } } if (!gangUnit.Orders.Any() && MathServices.EuclidianDistance(gangUnit.Point, point) > 5) // If the unit is doing nothing and is not standing on a base { foreach (var colony in _eStarts) // Queue an attack move command on each enemy starting location { _combatManager.AttackMove(theGang, colony.Point, true); } } } } }
public ProfessorsController(MathSiteDbContext context, MathServices services, IMapper mapper, CrudServiceMethods <Professor, ProfessorDto> crudServiceMethods, PageableServiceMethods <Professor, ProfessorDto> pageableServiceMethods, CountableServiceMethods <Professor> countableServiceMethods) : base(context, services, mapper) { _crudServiceMethods = crudServiceMethods; _pageableServiceMethods = pageableServiceMethods; _countableServiceMethods = countableServiceMethods; }
public FilesController( IFileFacade fileFacade, MathSiteDbContext context, MathServices services, IMapper mapper, CrudServiceMethods <Entities.File, FileDto> crudServiceMethods ) : base(context, services, mapper) { _fileFacade = fileFacade; _crudServiceMethods = crudServiceMethods; _fileFormatBuilder = new FileFormatBuilder(); }
public CategoriesController( MathSiteDbContext context, MathServices services, IMapper mapper, CrudServiceMethods <Category, CategoryDto> crudServiceMethods, PageableServiceMethods <Category, CategoryDto> pageableServiceMethods, CountableServiceMethods <Category> countableServiceMethods ) : base(context, services, mapper) { _crudServiceMethods = crudServiceMethods; _pageableServiceMethods = pageableServiceMethods; _countableServiceMethods = countableServiceMethods; }
public GroupsController( MathSiteDbContext context, MathServices services, IMapper mapper, CrudServiceMethods <Group, GroupDto> crudServiceMethods, PageableServiceMethods <Group, GroupDto> pageableServiceMethods, CountableServiceMethods <Group> countableServiceMethods ) : base(context, services, mapper) { _crudServiceMethods = crudServiceMethods; _pageableServiceMethods = pageableServiceMethods; _countableServiceMethods = countableServiceMethods; }
public FileFacade( MathSiteDbContext context, MathServices services, IFileStorage fileStorage, IMapper mapper ) { Context = context; Services = services; Repository = context.Set <File>(); _fileStorage = fileStorage; Mapper = mapper; }
public UsersController( MathSiteDbContext context, MathServices services, IMapper mapper, IPasswordsManager passwordsManager, CrudServiceMethods <User, UserDto> crudServiceMethods, PageableServiceMethods <User, UserDto> pageableServiceMethods, CountableServiceMethods <User> countableServiceMethods ) : base(context, services, mapper) { _passwordsManager = passwordsManager; _crudServiceMethods = crudServiceMethods; _pageableServiceMethods = pageableServiceMethods; _countableServiceMethods = countableServiceMethods; }
//TODO: Make smarter. private void UpdatePower(PowerSource source) { var p = source.Pos.ConvertTo2D(); var r = source.Radius; var startX = MathF.Round(p.X - r); var startY = MathF.Round(p.Y - r); var size = (int)(r * 2); var mx = (int)startX + size; var my = (int)startY + size; for (int x = (int)startX; x < mx; x++) { for (int y = (int)startY; y < my; y++) { if (MathServices.EuclidianDistance(p, x, y) <= r) { Power.Set(x, y, 1); } } } }
public void OnStep() { var workerAmount = _intel.WorkersSelf().Count(); if (!_intel.ProductionQueue.Any() && workerAmount < _baseAmount * 16) { for (int i = _intel.WorkersSelf().Count(); i < _baseAmount * 16; i++) { _productionManager.QueueUnit(workerType); } } else if (!_intel.ProductionQueue.Any()) //TODO Seemingly 4 SCV's get stuck in the production queue but is never made(using AutoExpand and AutoSupply) { var curCol = _mainBuildings.Units.First(); //TODO Use AStar distance rather than a Euclidian distance var nextCol = _intel.Colonies.OrderBy(c => MathServices.EuclidianDistance(curCol.Point, c.Point)).FirstOrDefault(col => col.Structures.Count == 0); if (nextCol != null) { _productionManager.QueueUnit(_mainBuildingTypes.First(), nextCol.Point, 3);//TODO the placement algorithm does not take mineral spacing from HQ's into account and giving a spacing of 3 will make other objects block the HQ's } } }
public EntityApiControllerBase(MathSiteDbContext context, MathServices services, IMapper mapper) : base(context, services, mapper) { }
public static void Main(string[] args) { var service = new MathServices(); //var number = service.MultiplyNumbers(1, 100); var unlimitedNumberTest = service.MultiplyUnlimitedNumbers(3, 3, 2147483647); }
protected ApiControllerBase(MathSiteDbContext context, MathServices services) { Context = context; Services = services; }