Hello everyone, I am new to Kotlin so I am currently exploring the niche things in it, I came up with the idea to code a "crude" CLI based game in kotlin as it would have me use a lot of things from enums to data classes in it so i saw fit for it to make it but I wanted some opinion on something I am trying to implement.
I am planning to create a global instance of MenuLoader class which will be used to display the menu and handle the user inputs, but I want to design it so that it can handle a types objects that can be further used to either generate new responses or do something to the game, is there a way for me to be able to create a data class that is not tightly coupled to only a specific type of object but rather is able to store and handle multiple type of object (i.e DialogGenerator, ActionClass, etc..)