I know this is a pretty stupid question, and it probably belongs on a generic C++ forum, but I’m not sure how to search for this. I have a board game with different pieces. Each piece has its own class which is a child of a “parent piece” class. I want this parent piece class to have a variable that can be overridden for each child piece. For example, each piece has its own “armor” variable value, so that I can cast to any piece and read ITS armor value. How could I do this?
Thanks in advance!