receiveDamage method
This method is called to give damage a this component.
Only receive damage if the method checkCanReceiveDamage return true
.
Implementation
void receiveDamage(
AttackFromEnum attacker,
double damage,
dynamic identify,
) {
if (checkCanReceiveDamage(attacker)) {
removeLife(damage);
}
}