public void HandlesBuildingTypeWithProtossBuilding(ProtossBuildingType building) { var buildingOrUnitType = new BuildingOrUnitType(building); var buildingType = new BuildingType(building); Assert.IsTrue(buildingOrUnitType == buildingType); }
public void HandlesBuildingOrUnitTypeWithZergUnit(ZergUnitType unit) { var buildingOrUnitType = new BuildingOrUnitType(unit); var otherBuildingOrUnitType = new BuildingOrUnitType(unit); Assert.IsTrue(buildingOrUnitType == otherBuildingOrUnitType); }
public void HandlesBuildingOrUnitTypeWithZergBuilding(ZergBuildingType building) { var buildingOrUnitType = new BuildingOrUnitType(building); var otherBuildingOrUnitType = new BuildingOrUnitType(building); Assert.IsTrue(buildingOrUnitType == otherBuildingOrUnitType); }
public void HandlesUnitTypeWithProtossUnit(ProtossUnitType unit) { var buildingOrUnitType = new BuildingOrUnitType(unit); var unitType = new UnitType(unit); Assert.IsTrue(buildingOrUnitType == unitType); }
private BuildingOrUnitType UnitOrPrerequisite(BuildingOrUnitType buildingOrUnit, GameState gameState) { var cost = gameState.Translator.GetCost(buildingOrUnit); if (!cost.HasPrerequisite(gameState)) { return(UnitOrPrerequisite(cost.Prerequisite, gameState)); } return(buildingOrUnit); }
public static ProxyStarcraft.Unit GetBuilder(BuildingOrUnitType buildingOrUnit, GameState gameState, SynchronousApiClient client) { // TODO: Exclude units/structures already building things var buildAction = gameState.Translator.GetBuildAction(buildingOrUnit); foreach (var unit in gameState.Units) { var abilities = client.GetAbilities(unit.Tag); if (abilities.Contains(buildAction)) { return(unit); } } return(null); }
public Command Produce(BuildingOrUnitType buildingOrUnit, GameState gameState) { var cost = gameState.Translator.GetCost(buildingOrUnit); var builder = cost.GetBuilder(gameState); gameState.Observation.PlayerCommon.Minerals -= cost.Minerals; gameState.Observation.PlayerCommon.Vespene -= cost.Vespene; gameState.Observation.PlayerCommon.FoodUsed += (uint)Math.Ceiling(cost.Supply); if (buildingOrUnit.IsBuildingType) { var buildingType = (BuildingType)buildingOrUnit; var location = this.GetPlacement(buildingType, gameState); return(builder.Build(buildingType, location)); } else { return(builder.Train((UnitType)buildingOrUnit)); } }
public void HandlesZergBuildingType(ZergBuildingType building) { var buildingType = new BuildingOrUnitType(building); Assert.IsTrue(buildingType == building); }
public void Add(BuildingOrUnitType target) { buildOrder.Push(target); }
public void Push(BuildingOrUnitType target) { buildOrder.Enqueue(target); }
public void HandlesZergUnitType(ZergUnitType unit) { var buildingOrUnitType = new BuildingOrUnitType(unit); Assert.IsTrue(buildingOrUnitType == unit); }
public void HandlesTerranBuildingType(TerranBuildingType building) { var buildingOrUnitType = new BuildingOrUnitType(building); Assert.IsTrue(buildingOrUnitType == building); }