I would store the formation pattern in an array or list of types where each element/type describes a position in the formation.
You could also store whether or not each position was occupied by a unit and if not select a unit to move itself to that position and join the formation.
Not quite sure what you mean by 'plug the gap' and I have a feeling this may have several possible solutions or have no meaning at all depending on the shape and position of the formation.
You could also store whether or not each position was occupied by a unit and if not select a unit to move itself to that position and join the formation.
Not quite sure what you mean by 'plug the gap' and I have a feeling this may have several possible solutions or have no meaning at all depending on the shape and position of the formation.