예제 #1
0
 public Option getMetaOption(Option defaultOption) {
   if (!metaOptions.containsKey(defaultOption.getName())) {
     setMetaOption(defaultOption);
     return defaultOption;
   }
   return getMetaOption(defaultOption.getName());
 }
예제 #2
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void reclaimArea(
     AIDelegate aiDelegate, CachedUnit unit, AIFloat3 pos, float radius, boolean queue) {
   AICommand command =
       new ReclaimAreaUnitAICommand(
           unit.getUnitId(), -1, queue ? queueOption : 0, commandTimeout.getValue(), pos, radius);
   handleCommand(aiDelegate, command);
 }
예제 #3
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void buildUnit(
     AIDelegate aiDelegate, CachedUnit builder, CachedUnitDef def, AIFloat3 pos, int facing) {
   AICommand command =
       new BuildUnitAICommand(
           builder.getUnitId(), -1, 0, commandTimeout.getValue(), def.getUnitDefId(), pos, facing);
   handleCommand(aiDelegate, command);
 }
예제 #4
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void fight(AIDelegate aiDelegate, CachedUnit unit, AIFloat3 pos, boolean queue) {
   AICommand command =
       new FightUnitAICommand(
           unit.getUnitId(), -1, queue ? queueOption : 0, commandTimeout.getValue(), pos);
   try {
     handleCommand(aiDelegate, command);
   } catch (Exception e) {
     System.err.println(unit.getDef().getHumanName() + "::" + FormatUtil.formatAIFloat3(pos));
   }
 }
예제 #5
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void guard(
     AIDelegate aiDelegate, CachedUnit unit, CachedUnit guard, boolean queue) {
   AICommand command =
       new GuardUnitAICommand(
           unit.getUnitId(),
           -1,
           queue ? queueOption : 0,
           commandTimeout.getValue(),
           guard.getUnitId());
   handleCommand(aiDelegate, command);
 }
예제 #6
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void reclaim(
     AIDelegate aiDelegate, CachedUnit unit, CachedUnit reclaim, boolean queue) {
   AICommand command =
       new ReclaimUnitAICommand(
           unit.getUnitId(),
           -1,
           queue ? queueOption : 0,
           commandTimeout.getValue(),
           reclaim.getUnitId());
   handleCommand(aiDelegate, command);
 }
예제 #7
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void factoryBuild(AIDelegate aiDelegate, String name, CachedUnit factory) {
   CachedUnitDef def = GlobalDelegate.getUnitDef(name, factory.getFaction());
   AICommand command =
       new BuildUnitAICommand(
           factory.getUnitId(),
           -1,
           0,
           commandTimeout.getValue(),
           def.getUnitDefId(),
           new AIFloat3(),
           0);
   handleCommand(aiDelegate, command);
 }
예제 #8
0
 public void setMetaOption(Option option) {
   if (metaOptions.containsKey(option.getName())) {
     Option currentOption = metaOptions.get(option.getName());
     currentOption.setValue(option.getValue());
   } else {
     metaOptions.put(option.getName(), option);
   }
 }
예제 #9
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void attack(
     AIDelegate aiDelegate, CachedUnit unit, CachedUnit attackUnit, boolean queue) {
   AICommand command =
       new AttackUnitAICommand(
           unit.getUnitId(),
           -1,
           queue ? queueOption : 0,
           commandTimeout.getValue(),
           attackUnit.getUnitId());
   try {
     handleCommand(aiDelegate, command);
   } catch (Exception e) {
     System.err.println(unit.getDef().getHumanName() + ", " + attackUnit.getUnitId());
   }
 }
예제 #10
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void stop(AIDelegate aiDelegate, CachedUnit unit) {
   AICommand command = new StopUnitAICommand(unit.getUnitId(), -1, 0, commandTimeout.getValue());
   handleCommand(aiDelegate, command);
 }
예제 #11
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void patrol(AIDelegate aiDelegate, CachedUnit unit, AIFloat3 pos, boolean queue) {
   AICommand command =
       new PatrolUnitAICommand(
           unit.getUnitId(), -1, queue ? queueOption : 0, commandTimeout.getValue(), pos);
   handleCommand(aiDelegate, command);
 }
예제 #12
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void setOnOff(AIDelegate aiDelegate, CachedUnit unit, boolean on) {
   AICommand command =
       new SetOnOffUnitAICommand(unit.getUnitId(), -1, 0, commandTimeout.getValue(), on);
   handleCommand(aiDelegate, command);
 }
예제 #13
0
파일: CommandUtil.java 프로젝트: hoijui/BAI
 public static void setMoveState(AIDelegate aiDelegate, CachedUnit unit, int moveState) {
   AICommand command =
       new SetMoveStateUnitAICommand(
           unit.getUnitId(), -1, 0, commandTimeout.getValue(), moveState);
   handleCommand(aiDelegate, command);
 }