示例#1
0
文件: Agent.cs 项目: evilz/TyrSc2
        public void Flee(Point2D retreatFrom, Point2D retreatTo)
        {
            PotentialHelper potential = new PotentialHelper(Unit.Pos, 4);

            potential.From(retreatFrom);
            potential.To(retreatTo);
            Order(Abilities.MOVE, potential.Get());
        }
示例#2
0
文件: Agent.cs 项目: evilz/TyrSc2
        public Point2D From(Point2D target, float magnitude)
        {
            PotentialHelper helper = new PotentialHelper(Unit.Pos);

            helper.Magnitude = magnitude;
            helper.From(target);
            return(helper.Get());
        }
示例#3
0
文件: Agent.cs 项目: evilz/TyrSc2
        public void Flee(Point2D retreatFrom)
        {
            PotentialHelper potential = new PotentialHelper(Unit.Pos, 4);

            potential.From(retreatFrom);
            Point2D fleeTo;

            if (Unit.IsFlying)
            {
                fleeTo = SC2Util.To2D(Bot.Main.MapAnalyzer.StartLocation);
            }
            else
            {
                fleeTo = Bot.Main.MapAnalyzer.Walk(SC2Util.To2D(Unit.Pos), Bot.Main.MapAnalyzer.MainDistances, 6);
            }
            potential.To(fleeTo);
            Order(Abilities.MOVE, potential.Get());
        }