Britbot
bool Britbot.EnemyGroup.IsInGroup ( int  enemyPirate) [inline]

Determines if an enemy pirate belongs to this enemy group.

Parameters:
enemyPirateThe index of the enemy pirate
Returns:
True if the pirate belongs to the group or false, otherwise

Definition at line 374 of file EnemyGroup.cs.

        {
            Pirate ePirate = Bot.Game.GetEnemyPirate(enemyPirate);

            //check if the pirate is null
            if (ePirate == null)
                return false;

            //Check if the given pirate is close (max of 2 distance units) to any of the pirates already in this group
            if (ePirate.IsLost)
                return false;

            return
                this.EnemyPirates.ConvertAll(e => Bot.Game.GetEnemyPirate(e))
                    .Any(e => Bot.Game.IsReallyInRange(ePirate.Loc, e.Loc));
        }