[Feature]: Implement new getX methods, allowing direct access instead of casting. #4809
Open
1 task done
Labels
feature
New feature or functionality
By submitting this feature issue, you agree to the following.
Request
Currently, some parts of the forgottenserver use
dynamic_cast
to check and convert object types. I propose the implementation of newgetX()
methods that directly return the desired type. Derived classes can implement these methods to provide specific access to the type, while the base class will return nullptr when the type is not applicable.This approach have any problem?
Example: Instead of using:
The code would become:
Thing would implement:
The text was updated successfully, but these errors were encountered: