create building unit for RTS

tell me how to create a classical building unit for the strategy (RTS)?

  1. One resorses
  2. allowed to build on flat terrain (with minor errors)
    Example games with builders: CnC Generals , Warhammer 40k, Lord Of The Kings

All I can think of right now you can do the following:
Create an character class which will be the builder unit, and setup an array of blueprint buildings: Let’s say you have a gold mind and farm buildings, using the UI you let the user choose the building and then when you click on it, project the building on the ground using the mouse, and on click place it.