handleAttack method

bool handleAttack(
  1. AttackOriginEnum attacker,
  2. double damage,
  3. dynamic identify
)

This method is called to give damage a this component. Only receive damage if the method checkCanReceiveDamage return true.

Implementation

bool handleAttack(
  AttackOriginEnum attacker,
  double damage,
  dynamic identify,
) {
  final canReceive = checkCanReceiveDamage(attacker);
  if (canReceive) {
    onReceiveDamage(attacker, damage, identify);
  }
  return canReceive;
}