示例#1
0
        /// <summary>
        /// Get the next attackable base for the given player.
        /// </summary>
        /// <param name="forPlayer"></param>
        /// <returns></returns>
        public Base GetAttackableBase(AIFramework.Bot.Game.Player forPlayer)
        {
            try
            {
                if (forPlayer.Team == GameSession.Alliance.RED)
                {
                    return(bases[blueAttackableBaseID]);
                }

                return(bases[redAttackableBaseID]);
            }
            catch (KeyNotFoundException)
            {
                return(null);
            }
        }
示例#2
0
        /// <summary>
        /// See if the given player can attack the given base.
        /// </summary>
        /// <param name="b"></param>
        /// <param name="player"></param>
        /// <returns></returns>
        public bool IsBaseAttackable(Base b, AIFramework.Bot.Game.Player player)
        {
            if (b.Team != player.Team)
            {
                bool inContention = false;
                int  id           = b.BaseID;
                if (player.Team == GameSession.Alliance.RED && id == blueAttackableBaseID)
                {
                    inContention = true;
                }
                else if (player.Team == GameSession.Alliance.BLUE && id == redAttackableBaseID)
                {
                    inContention = true;
                }

                return(inContention);
            }

            return(false);
        }