Alright, so I won't bother with checking for structure overlaps, just to let people do some of the exotic things.
Eddy-B: I plan on making it so you can specify any template to create unit code with. The CreateUnit and Hooville struct styles will be built in, but I'll make it so you can write templates to create them using your own functions.
Here's an example of the template design I was planning (say, you wanted to do it with building groups):
$$Begin // code inserted above everything
void SetupBase()
{
BuildingGroup b;
$$Player // code inserted before each player
b = CreateBuildingGroup(Player[ $PlayerId ]);
$$Unit // code inserted before each unit
b.RecordBuilding( LOCATION( $x, $y ), $UnitMapId, $WeaponMapId );
$$EndUnit // code inserted after each unit
// nothing
$$EndPlayer // code inserted after each player
b.Destroy();
$$End // code inserted at the end
}
So as you can see, it would parse a bunch of sections and insert them as needed, and substitute variables. This way it's fully flexible, and actually could be used for totally different languages.
Example generated code from template above:
void SetupBase()
{
BuildingGroup b;
b = CreateBuildingGroup(Player[ 0 ]);
b.RecordBuilding( LOCATION( 10, 20 ), mapCommandCenter, mapNone );
// nothing
b.Destroy();
b = CreateBuildingGroup(Player[ 1 ]);
// . . .
}
Seem simple enough? Need it more or less complex?