public void onEnemyShown(Unit unit)
 {
     State.onEnemyShown(unit);
     AIState.onEnemyShown(unit);
     var type = unit.getType();
     bwapi.Broodwar.printf(String.Format("Enemy spotted: {0}", type.getName()));            
 }
Beispiel #2
0
 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() + "]");
     }
 }
Beispiel #3
0
 public virtual bool useTech(TechType tech, Unit target) {
   bool ret = bwapiPINVOKE.Unit_useTech__SWIG_2(swigCPtr, TechType.getCPtr(tech), Unit.getCPtr(target));
   if (bwapiPINVOKE.SWIGPendingException.Pending) throw bwapiPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Beispiel #4
0
 public virtual bool follow(Unit target) {
   bool ret = bwapiPINVOKE.Unit_follow(swigCPtr, Unit.getCPtr(target));
   return ret;
 }
Beispiel #5
0
 public virtual bool unload(Unit target) {
   bool ret = bwapiPINVOKE.Unit_unload(swigCPtr, Unit.getCPtr(target));
   return ret;
 }
Beispiel #6
0
public bool Equals(Unit obj) 
{
    if (obj == null) return false;
    return (obj.swigCPtr.Handle == this.swigCPtr.Handle);
}
Beispiel #7
0
 public virtual bool attackUnit(Unit target) {
   bool ret = bwapiPINVOKE.Unit_attackUnit(swigCPtr, Unit.getCPtr(target));
   return ret;
 }
 void IStarcraftBot.onUnitRenegade(SWIG.BWAPI.Unit unit)
 {
     //throw new NotImplementedException();
 }
Beispiel #9
0
 public virtual bool hasPath(Unit target) {
   bool ret = bwapiPINVOKE.Unit_hasPath__SWIG_0(swigCPtr, Unit.getCPtr(target));
   return ret;
 }
Beispiel #10
0
 void IStarcraftBot.onUnitRenegade(SWIG.BWAPI.Unit unit)
 {
     UnitRenegade[Core.Timer.Time()] = unit;
 }
 public UnitCommand(Unit _unit, UnitCommandType _type, Unit _target, int _x, int _y, int _extra) : this(bwapiPINVOKE.new_UnitCommand__SWIG_1(Unit.getCPtr(_unit), UnitCommandType.getCPtr(_type), Unit.getCPtr(_target), _x, _y, _extra), true) {
   if (bwapiPINVOKE.SWIGPendingException.Pending) throw bwapiPINVOKE.SWIGPendingException.Retrieve();
 }
Beispiel #12
0
 void IStarcraftBot.onUnitDestroy(SWIG.BWAPI.Unit unit)
 {
     UnitDestroyed[Core.Timer.Time()] = unit;
 }
Beispiel #13
0
 void IStarcraftBot.onUnitMorph(SWIG.BWAPI.Unit unit)
 {
     UnitMorphed[Core.Timer.Time()] = unit;
 }
Beispiel #14
0
 void IStarcraftBot.onUnitCreate(SWIG.BWAPI.Unit unit)
 {
     UnitCreated[Core.Timer.Time()] = unit;
 }
Beispiel #15
0
 void IStarcraftBot.onUnitShow(SWIG.BWAPI.Unit unit)
 {
     UnitShow[Core.Timer.Time()] = unit;
 }
Beispiel #16
0
 void IStarcraftBot.onUnitDiscover(SWIG.BWAPI.Unit unit)
 {
     UnitDiscovered[Core.Timer.Time()] = unit;
 }
 public virtual void onUnitMorph(Unit unit) {
   bwapiPINVOKE.AIModule_onUnitMorph(swigCPtr, Unit.getCPtr(unit));
 }
 public static UnitCommand attackUnit(Unit unit, Unit target) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_attackUnit(Unit.getCPtr(unit), Unit.getCPtr(target)), true);
   return ret;
 }
 public static UnitCommand upgrade(Unit unit, UpgradeType upgrade) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_upgrade(Unit.getCPtr(unit), UpgradeType.getCPtr(upgrade)), true);
   if (bwapiPINVOKE.SWIGPendingException.Pending) throw bwapiPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
 void IStarcraftBot.onUnitDiscover(SWIG.BWAPI.Unit unit)
 {
     //throw new NotImplementedException();
 }
 public static UnitCommand attackMove(Unit unit, Position target) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_attackMove(Unit.getCPtr(unit), Position.getCPtr(target)), true);
   if (bwapiPINVOKE.SWIGPendingException.Pending) throw bwapiPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
 public static UnitCommand setRallyPoint(Unit unit, Position target) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_setRallyPoint__SWIG_0(Unit.getCPtr(unit), Position.getCPtr(target)), true);
   if (bwapiPINVOKE.SWIGPendingException.Pending) throw bwapiPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }
Beispiel #23
0
 public virtual double getDistance(Unit target) {
   double ret = bwapiPINVOKE.Unit_getDistance__SWIG_0(swigCPtr, Unit.getCPtr(target));
   return ret;
 }
 public static UnitCommand setRallyPoint(Unit unit, Unit target) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_setRallyPoint__SWIG_1(Unit.getCPtr(unit), Unit.getCPtr(target)), true);
   return ret;
 }
Beispiel #25
0
 internal static HandleRef getCPtr(Unit obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
 public static UnitCommand lift(Unit unit) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_lift(Unit.getCPtr(unit)), true);
   return ret;
 }
Beispiel #27
0
 public virtual bool isInWeaponRange(Unit target) {
   bool ret = bwapiPINVOKE.Unit_isInWeaponRange(swigCPtr, Unit.getCPtr(target));
   return ret;
 }
 public static UnitCommand unloadAll(Unit unit) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_unloadAll__SWIG_0(Unit.getCPtr(unit)), true);
   return ret;
 }
Beispiel #29
0
 public virtual bool setRallyPoint(Unit target) {
   bool ret = bwapiPINVOKE.Unit_setRallyPoint__SWIG_1(swigCPtr, Unit.getCPtr(target));
   return ret;
 }
 public static UnitCommand rightClick(Unit unit, Unit target) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_rightClick__SWIG_1(Unit.getCPtr(unit), Unit.getCPtr(target)), true);
   return ret;
 }
Beispiel #31
0
 public virtual bool repair(Unit target) {
   bool ret = bwapiPINVOKE.Unit_repair(swigCPtr, Unit.getCPtr(target));
   return ret;
 }
 public static UnitCommand haltConstruction(Unit unit) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_haltConstruction(Unit.getCPtr(unit)), true);
   return ret;
 }
Beispiel #33
0
 public virtual bool rightClick(Unit target) {
   bool ret = bwapiPINVOKE.Unit_rightClick__SWIG_1(swigCPtr, Unit.getCPtr(target));
   return ret;
 }
 public static UnitCommand cancelTrain(Unit unit) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_cancelTrain__SWIG_1(Unit.getCPtr(unit)), true);
   return ret;
 }
 public virtual void onUnitDiscover(Unit unit) {
   bwapiPINVOKE.AIModule_onUnitDiscover(swigCPtr, Unit.getCPtr(unit));
 }
 public static UnitCommand cancelUpgrade(Unit unit) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_cancelUpgrade(Unit.getCPtr(unit)), true);
   return ret;
 }
 public virtual void onUnitRenegade(Unit unit) {
   bwapiPINVOKE.AIModule_onUnitRenegade(swigCPtr, Unit.getCPtr(unit));
 }
 public static UnitCommand useTech(Unit unit, TechType tech, Unit target) {
   UnitCommand ret = new UnitCommand(bwapiPINVOKE.UnitCommand_useTech__SWIG_2(Unit.getCPtr(unit), TechType.getCPtr(tech), Unit.getCPtr(target)), true);
   if (bwapiPINVOKE.SWIGPendingException.Pending) throw bwapiPINVOKE.SWIGPendingException.Retrieve();
   return ret;
 }