Skip to content

Instantly share code, notes, and snippets.

@Velsimir
Last active September 5, 2023 07:53
Show Gist options
  • Save Velsimir/a0f821c62894f3049e2291a24c0b8485 to your computer and use it in GitHub Desktop.
Save Velsimir/a0f821c62894f3049e2291a24c0b8485 to your computer and use it in GitHub Desktop.
class Weapon
{
private int _bullets;
private const int _zeroBullets = 0;
private const int _bulletShot = 1;
public bool CanShoot => _bulletShot <= _bullets;
public void Shoot()
{
if (CanShoot)
_bullets -= _bulletShot;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment