Not sure if array is totally required for this although it could act as a way to view all data. In the end you will be pulling variable data into the array and those variables would be good enough. So a farm would have production type which is a string variable, number of stored or created products, production time/speed as number variables etc.
If I was to put all this data in an array, what you can do is give each building an identifier which is the position or row in the array. Then with logic you link up the building's values to the array, so type = array.at(building.arrayposition,0), production time = array.at(building.arrayposition,1). This would allow all buildings to put their data into the array with very little code.
Also I would advise putting all buildings into a buildings family for this, so you do not have duplicate code referencing different buildings, farm.arrayposition,0 and mill.arrayposition,0 become building.arrayposition,0 if you use families and family instance variables to group them.