Britbot
static void Britbot.Commander.FixGroupArrangement ( ) [inline, static, private]

Moves pirates between groups if needed (physically)

Definition at line 553 of file Commander.cs.

        {
            //going over all pair of groups
            foreach (Group g1 in Commander.Groups)
            {
                foreach (Group g2 in Commander.Groups)
                {
                    //check if it is the same
                    if (g1.Equals(g2))
                        continue;

                    //check if they are messed out
                    if (Group.CheckIfGroupsIntersects(g1, g2))
                    {
                        //find larger group
                        if (g1.Pirates.Count > g2.Pirates.Count)
                        {
                            Group.Switch(g1, g2);
                        }
                        else
                        {
                            Group.Switch(g2, g1);
                        }
                    }
                }
            }
        }