Maybe my explanation of the terrain restrictions were not 100% complete, sorry
Terrain restrictions theirselves can absolutely not be linked directly to a terrain because terrain restrictions have different properties for the same terrain, linking the restriction data to the terrain itself would lead to 1 terrain restriction
Tho you can link the graphics to the terrain id if you specify the graphic id for each assigned unit ID
I will explain the terrain structure purpose on a simple example with just 3 different terrains.
Terrains List:
1 = Grass 1
2 = Desert
3 = Water 1
Note: Build also means being able to place the object on that type of land in the editor
Restrictions List:
RESTRICTION_ID = 1 (This will be for Infantry)
AMOUNT_OF_TERRAINS = 3
TERRAIN_1_ALLOW_ACCESS = YES
TERRAIN_1_ALLOW_BUILD = YES
TERRAIN_2_ALLOW_ACCESS = YES
TERRAIN_2_ALLOW_BUILD = YES
TERRAIN_3_ALLOW_ACCESS = NO
TERRAIN_3_ALLOW_BUILD = NO
RESTRICTION_ID = 2 (This will be for ships)
AMOUNT_OF_TERRAINS = 3
TERRAIN_1_ALLOW_ACCESS = NO
TERRAIN_1_ALLOW_BUILD = NO
TERRAIN_2_ALLOW_ACCESS = NO
TERRAIN_2_ALLOW_BUILD = NO
TERRAIN_3_ALLOW_ACCESS = YES
TERRAIN_3_ALLOW_BUILD = YES
RESTRICTION_ID = 3 (this will be for normal buildings)
AMOUNT_OF_TERRAINS = 3
TERRAIN_1_ALLOW_ACCESS = YES
TERRAIN_1_ALLOW_BUILD = YES
TERRAIN_2_ALLOW_ACCESS = YES
TERRAIN_2_ALLOW_BUILD = YES
TERRAIN_3_ALLOW_ACCESS = NO
TERRAIN_3_ALLOW_BUILD = NO
And if you assign a restriction ID to a object, it will have all rules declared in the restriction.
This will save aload of data because restrictions have only to be written once and will only be linked to with a number.
I suggest you also add the graphical info to these restrictions because they also have to be written once and will automatically apply if the unit ID got the correct restriction ID assigned.