When my project is really has great code structure, where using almost everywhere different datatypes, whether it makes sense to store many types (eg USTRUCTs) of data in a single header?
MyGameDataTypes.h for example. Where I declared the FCat, FDog, FElephant, etc…
#include "MyGameDataTypes.generated.h"
USTRUCT()
struct FCat
{
... // much properties here
};
USTRUCT()
struct FDog
{
... // much properties here
};
USTRUCT()
struct FElephant
{
... // much properties here
};
Or for best way I must create every header individually for each my USTRUCT?
Cat.h where struct FCat
Dog.h where struct FDog
Elephant.h where struct FElephant
etc…
Or there are better ways and this above is nonsense?
You should be able to list multiple structs in a single header file and still have access to them as needed. Using the pseudo-code provided, you could have each of the structs listed inside an Animal.h class rather than having to have a specific class for each struct.
And what about more generic types? Not only animals?
For example types using in UI, network transmission, etc. Is good way to define all of that types in single header? Like a Common/Types.h where I can find all types without specific category, but that can be used everywhere.
Yes, that should be possible. I was only using Animal.h as an example based on the structs you mentioned originally. Structs defined inside one class should be available for use from other classes as long as the other class has an include statement for the class where the struct is defined or the Struct is marked with USTRUCT so that it is visible to the editor.