public void onUnitShow(Unit unit) { if (unit.getPlayer().isEnemy(bwapi.Broodwar.self())) { DecisionMaker.onEnemyShown(unit); } if (unit.getType().getName() == "Resource Mineral Field") { DecisionMaker.onfoundMinerals(new BW.Unit(unit)); } if (DecisionMaker.AIState.ToString() != "PreInitialize") { // PrintMessage("Unit Shown: [" + unit.getType().getName() + "] at [" + unit.getPosition().xConst() + "," + unit.getPosition().yConst() + "]"); } }
public void onUnitMorph(Unit unit) { if (unit.getPlayer() == bwapi.Broodwar.self()) { if (DecisionMaker.AIState.ToString() != "PreInitialize") { // PrintMessage("Unit Created: [" + unit.getType().getName() + "] at [" + unit.getPosition().xConst() + "," + unit.getPosition().yConst() + "]"); } DecisionMaker.onMyUnitMorph(unit); } }
public void onUnitComplete(Unit unit) { if (unit.getPlayer() == bwapi.Broodwar.self()) { if (DecisionMaker.AIState.ToString() != "PreInitialize") { // PrintMessage("Unit Completed: [" + unit.getType().getName() + "] at [" + unit.getPosition().xConst() + "," + unit.getPosition().yConst() + "]"); } DecisionMaker.onMyUnitCompleted(unit); } var actual_type = unit.getType(); // Console.WriteLine(actual_type.getName()); }
public void onUnitDestroy(Unit unit) { if (unit.getPlayer() == bwapi.Broodwar.self()) { DecisionMaker.onMyUnitDestroyed(unit); } Console.WriteLine("destroyed"); }