Dynamically creating objects at runtime that inherit from a base class
- by Homeliss
I am writing a game editor, and have a lot of different "tool" objects. They all inherit from BTool and have the same constructor.
I would like to dynamically populate a toolbox at runtime with buttons that correspond to these tools, and when clicked have them create an instance of that tool and set it as the current tool.
Is this possible, and if so will it be better/easier than creating those buttons by hand?