Hello,
I started to learn UE4 this week. By the way I am learning C++ basics at the same time so this question can be related to C++ not UE4.
In tutorial of battery collector, author uses virtual methods in parent class to enable children classes to override it.
So it is like that.
parent.h:
UFUNCTION(BlueprintNativeEvent)
void WasCollected();
virtual void WasCollected_Implementation();
parent.cpp
//no implementation for WasCollected method.
void APickup::WasCollected_Implementation()
{
//Some implementation code
}
child.h
void WasCollected_Implementation() override;
child.cpp
void ABatteryPickup::WasCollected_Implementation()
{
Super::WasCollected_Implementation();
//Some code overriding parent method.
}
In another class whole functionality is made by calling WasCollected method even it is just declared header file of parent.
So how is it works. Is _Implementation special key word or something like that for overriding methods. Because as I am looking this code, it shouldn’t work.