|
Britbot
|
A method that refers to the ULTIMATE CONFIGURATION and splits the gruops as needed. Definition at line 43 of file ConfigHelper.cs. {
List<Group> newGroups = new List<Group>();
ultimateConfig.Sort((b, a) => a.CompareTo(b));
Commander.Groups.Sort((b, a) => a.Pirates.Count.CompareTo(b.Pirates.Count));
for (int i = 0; i < Math.Min(ultimateConfig.Count, Commander.Groups.Count); i++)
{
if (Commander.Groups[i].Pirates.Count > ultimateConfig[i])
newGroups.AddRange(Commander.Groups[i].Split(Commander.Groups[i].Pirates.Count - ultimateConfig[i]));
}
Commander.Groups.AddRange(newGroups);
Commander.Groups.RemoveAll(g => g.Pirates.Count == 0);
}
|
1.7.6.1