Esempio n. 1
0
        public int _botsInArena;           //How many bots currently in the arena

        ///////////////////////////////////////////////////
        // Member Functions
        ///////////////////////////////////////////////////
        /// <summary>
        /// Takes care of all bots in the arena
        /// </summary>
        private void pollBots()
        {         //Handle each bot
            foreach (Bot bot in _bots.ToList())
            {     //Does it need to send an update?
                if (bot.poll())
                { //Prepare and send an update packet for the vehicle
                    bot._state.updateNumber++;

                    Helpers.Update_RouteBot(bot);

                    //Update the bot's state
                    if (!bot.bCondemned)
                    {
                        _vehicles.updateObjState(bot, bot._state);
                        _bots.updateObjState(bot, bot._state);
                    }

                    //Only shoot once!
                    bot._itemUseID = 0;
                }

                if (bot.bCondemned)
                {
                    _condemnedBots.Add(bot);
                }
            }

            foreach (Bot bot in _condemnedBots)
            {
                _bots.Remove(bot);
            }
            _condemnedBots.Clear();
        }
Esempio n. 2
0
        /// <summary>
        /// Handles the loss of a ball
        /// </summary>
        public void LostBall(Ball ball)
        {
            if (ball == null)
            {
                return;
            }

            //Let it go
            _balls.Remove(ball);
        }
Esempio n. 3
0
        /// <summary>
        /// Handles the loss of a ball
        /// </summary>
        public void lostBall(Ball ball)
        {
            if (ball == null)
            {
                return;
            }

            //Let it go
            _balls.Remove(ball);

            //Send it
            Helpers.Object_BallReset(Players, ball);
        }