base
is used to call a method of one of the derived classes, ignoring methods of the current class (that is, "non-virtual calls"). To reference the object itself whose code is being executed, use this
, just like in java.
RocketPlayer pl = this;
In my opinion, the question "How do I reference the" parent "within the method?" it does not make sense. There are no two objects in this context (parent and child), there is only one. This object is of type UPlayer
, and this type is derived from type RocketPlayer
.
It is important to distinguish between types (classes, interfaces, etc.) and objects (instantiations of these types). In this context, there are 2 types but only 1 object that can be referenced.