I am working on a 2D game and doing procedural generation of 2D maps. This includes placing entities like stones, trees or similar
Describe the problem or limitation you are having in your project
To have a clearer strucure and not have a single huge config class for different entities, I would like to abstract the config class so that I have one config class per entity which inherits from the base config class.
To use the inherited config in an actual class, it has to be a generic class which includes the generic type as attribute. It is not possible at the moment to export generics.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Allowing exporting the generic attribute would improve the code structure a lot and you do not have to rely on a single giant config class for all entities.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
It should look like this in the inspector:
Clicking on on the config attribute in the inspector would only show the generic type resources (in this case EntityStoneConfig)
Use case example
EntityConfig Base class
EntityConfig Stone class
EntityConfig Tree class
Entity Base class
Entity Tree class (this will be added to the Nodes)
Entity Stone class (this will be added to the Nodes)
If this enhancement will not be used often, can it be worked around with a few lines of script?
There is no known workaround at the moment
Is there a reason why this should be core and not an add-on in the asset library?
This should be core because C# is at the moment also a core language in Godot which has some small limitations. With allowing generic classes / nodes in the last year this is a case which has been missing since.
Describe the project you are working on
I am working on a 2D game and doing procedural generation of 2D maps. This includes placing entities like stones, trees or similar
Describe the problem or limitation you are having in your project
To have a clearer strucure and not have a single huge config class for different entities, I would like to abstract the config class so that I have one config class per entity which inherits from the base config class.
To use the inherited config in an actual class, it has to be a generic class which includes the generic type as attribute. It is not possible at the moment to export generics.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Allowing exporting the generic attribute would improve the code structure a lot and you do not have to rely on a single giant config class for all entities.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
It should look like this in the inspector:
Clicking on on the config attribute in the inspector would only show the generic type resources (in this case EntityStoneConfig)
Use case example
EntityConfig Base class
EntityConfig Stone class
EntityConfig Tree class
Entity Base class
Entity Tree class (this will be added to the Nodes)
Entity Stone class (this will be added to the Nodes)
If this enhancement will not be used often, can it be worked around with a few lines of script?
There is no known workaround at the moment
Is there a reason why this should be core and not an add-on in the asset library?
This should be core because C# is at the moment also a core language in Godot which has some small limitations. With allowing generic classes / nodes in the last year this is a case which has been missing since.