public void TakeDamage(int damage) { _currentHealth.Value -= damage; UpdateHealth(); if (_currentHealth.Value <= 0) { onDeath?.Raise(_currentHealth); } }
private void UpdateHealth() { onHealthUpdated?.Raise(_currentHealth); }