addLife method

void addLife(
  1. double life
)

Increase life

Implementation

void addLife(double life) {
  double newLife = _life + life;

  if (newLife > maxLife) {
    newLife = maxLife;
  }
  onRestoreLife(newLife - _life);
  _life = newLife;

  _verifyLimitsLife();
}