|
Britbot
|
Get the structure for the group.
Definition at line 611 of file Group.cs. {
//find the required ring index for this group (see proof in calculation folder in the repo)
int maxRing = (int) Math.Ceiling((decimal) (this.Pirates.Count - 1) / 4);
//list of location in all the rings. Note that we add one because ring # is 0-based
Location[][] rings = new Location[maxRing + 1][];
//generate the locations for each ring
for (int i = 0; i < rings.Length; i++)
{
rings[i] = Group.GenerateRingLocations(pivot, i).ToArray();
}
/*
* trim the last ring if required. i.e. if we have 4 pirate, maxRing will be 1 and it will have 5 spots.
* so if trimming was required the last ring will be trimmed to 3 (so 3 + 1 is the number of pirates in this group).
*/
if (trim)
{
int spareSpots = Group.GetStructureVolume(maxRing) - this.Pirates.Count;
rings[maxRing] = rings[maxRing].Take(rings[maxRing].Length - spareSpots).ToArray();
}
//return the location array
return rings;
}
|
1.7.6.1