항암제
Derived class , BaseClass, Dictionary
Thank you for your response.
I'm currently working on creating a card game as a learning project. As I contemplate how to manage the cards, I wanted to organize them within a data structure. To differentiate between the cards, I intended to assign unique ID values to each card. When I input a card's ID, I aim to retrieve its Name, Cost, and Effect from the data structure for use. I tested this, and the attached picture shows the result.
My question is, within the data structure, there is a BaseClass, and when I make a call, it seems to output the method of the child class that overrides the base class method. I'm curious if this behavior is expected, and I'd like to understand how it works internally.
11 replies