Britbot
static bool Britbot.EnemyGroup.IsInGroup ( List< int >  group,
int  enemyPirate 
) [inline, static]

Determines if an enemy pirate belongs to to the group of id's specified.

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

Definition at line 397 of file EnemyGroup.cs.

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

            if (ePirate.IsLost)
                return false;

            //Check if the given pirate is close (max of 2 distance units) to any of the pirates already in this group
            return
                group.ConvertAll(e => Bot.Game.GetEnemyPirate(e))
                    .Select(ep => Bot.Game.Distance(ep, ePirate))
                    .Concat(new int[] {})
                    .Min() <= 2;
        }