Currently, there is no possibility to retrieve all components that extend from a base component, which would be a great feature for writing decoupled code.
For example, I have different types of Interaction Classes for things like Seats or Heal Stations, that all derive from a BaseInteraction Class for common functionality. Then, I have a GUI to display an interaction prompt on all of these. Currently, I have to call getAllComponents() for each of these Interaction Classes manually (Which also means I have to reference them), instead of using one getAllComponents() call that supports Polymorphism.
I know that could be hard to implement as these types don't really exist on runtime, but I could imagine something like this working through the metadata that Flamework defines for each Component.
(Kind of related to https://github.com/rbxts-flamework/core/issues/33, but also different)
Currently, there is no possibility to retrieve all components that extend from a base component, which would be a great feature for writing decoupled code.
For example, I have different types of Interaction Classes for things like Seats or Heal Stations, that all derive from a
BaseInteraction
Class for common functionality. Then, I have a GUI to display an interaction prompt on all of these. Currently, I have to callgetAllComponents()
for each of these Interaction Classes manually (Which also means I have to reference them), instead of using onegetAllComponents()
call that supports Polymorphism.I know that could be hard to implement as these types don't really exist on runtime, but I could imagine something like this working through the metadata that Flamework defines for each Component.