Пример #1
0
 public override bool Execute(Beholder bot)
 {
     Controller.Move(new List <Unit>()
     {
         bot.GetAvailableWorker()
     }, Postition);
     return(true);
 }
 public override bool Execute(Beholder bot)
 {
     if (Controller.CanConstruct(Units.HATCHERY))
     {
         return(bot.Expand());
     }
     return(false);
 }
 public override bool Execute(Beholder bot)
 {
     if (Controller.CanConstruct(BuildingToConstruct))
     {
         Controller.Construct(bot.GetAvailableWorker(), BuildingToConstruct, ConstructionSpot);
         return(true);
     }
     return(false);
 }
Пример #4
0
        public override bool Execute(Beholder bot)
        {
            var army = Controller.GetUnits(Units.ArmyUnits);

            if (army.Count > 0)
            {
                if (Controller.EnemyLocations.Count > 0)
                {
                    Controller.Attack(army, Controller.EnemyLocations[0]);
                    return(true);
                }
            }
            return(false);
        }
        public void ExecuteBO(Beholder bot)
        {
            var command = BO.Peek();

            switch (command.Behavior)
            {
            case CommandBehavior.Blocking: if (command.TryExecute(bot))
                {
                    BO.Dequeue();
                }
                break;

            case CommandBehavior.NonBlocking: bot.ASyncCommands.Add(command); BO.Dequeue(); break;

            case CommandBehavior.Repetative: bot.RepetativeCommands.Add(command); BO.Dequeue(); break;
            }
        }
        public override bool Execute(Beholder bot)
        {
            if (BuildingToConstruct == null)
            {
                switch (bot.GetRace())
                {
                case SC2APIProtocol.Race.Zerg: BuildingToConstruct = Units.EXTRACTOR; break;

                case SC2APIProtocol.Race.Protoss: BuildingToConstruct = Units.REFINERY; break;

                case SC2APIProtocol.Race.Terran: BuildingToConstruct = Units.ASSIMILATOR; break;

                default: throw new NotImplementedException();
                }
            }
            if (Controller.CanConstruct(BuildingToConstruct.Value))
            {
                Controller.ConstructGas(bot.GetAvailableWorker(), BuildingToConstruct.Value, Geyser);
                return(true);
            }
            return(false);
        }
Пример #7
0
        public override bool Execute(Beholder bot)
        {
            var unit = Controller.GetUnit(UnitType);

            return(unit != null);
        }
Пример #8
0
 public abstract bool Execute(Beholder bot);
Пример #9
0
 public bool TryExecute(Beholder bot)
 {
     return((Condition == null || Condition.IsTrue()) && Execute(bot));
 }
 public override bool Execute(Beholder bot)
 {
     return(Controller.BuildUnit(UnitToBuild));
 }
Пример #11
0
 public override bool Execute(Beholder bot)
 {
     Controller.Chat(Message);
     return(true);
 }
 public override bool Execute(Beholder bot)
 {
     return(Controller.Cancel(UnitToCancel));
 }