Ejemplo n.º 1
0
        private void goTo(EChars bot, double x, double y)
        {
            int id = getIdByName(bot);

            Bots[id].X = x;
            Bots[id].Y = y;
        }
Ejemplo n.º 2
0
        private double nearestEnemy(EChars bot)
        {
            double min = 1000,
                   dist;
            Bot mine = getBot(bot);

            foreach (Bot enemy in input.Enemy.Bots)
            {
                dist = botToPoint(enemy, mine.X, mine.Y);
                if (dist < min)
                {
                    min = dist;
                }
            }
            return(min);
        }
Ejemplo n.º 3
0
        private void passToNearest(EChars sender, params EChars[] bots)
        {
            double min      = 1000,
                   dist     = 0;
            EChars receiver = EChars.Attacker;

            foreach (EChars bot in bots)
            {
                dist = botToPoint(sender, bot);
                if (dist < min)
                {
                    receiver = bot;
                    min      = dist;
                }
            }
            pass(receiver);
        }
Ejemplo n.º 4
0
 private bool hasBall(EChars bot)
 {
     return(getBot(bot).HasBall);
 }
Ejemplo n.º 5
0
        private void pass(EChars bot)
        {
            Bot receiver = getBot(bot);

            kick(receiver.X, receiver.Y);
        }
Ejemplo n.º 6
0
 private Bot getBot(EChars bot)
 {
     return(Bots[(int)bot]);
 }
Ejemplo n.º 7
0
        private double botToPoint(EChars bot, double x, double y)
        {
            int id = getIdByName(bot);

            return(Math.Sqrt(Math.Pow(Bots[id].X - x, 2) + Math.Pow(Bots[id].Y - y, 2)));
        }
Ejemplo n.º 8
0
        private double botToPoint(EChars bot1, EChars bot2)
        {
            Bot bot2r = getBot(bot2);

            return(botToPoint(bot1, bot2r.X, bot2r.Y));
        }
Ejemplo n.º 9
0
 private double botToPoint(EChars bot, bool to = true)
 {
     return(botToPoint(bot, input.Ball.GetX(to), input.Ball.GetY(to)));
 }
Ejemplo n.º 10
0
 private void goTo(EChars bot, bool to = true)
 {
     goTo(bot, input.Ball.GetX(to), input.Ball.GetY(to));
 }
Ejemplo n.º 11
0
 private int getIdByName(EChars bot)
 {
     return((int)bot);
 }