Last active
September 5, 2023 07:53
-
-
Save Velsimir/a0f821c62894f3049e2291a24c0b8485 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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