public bool TryFire() { if (!HasShot) // Won't shoot if has "no ammo" { return(false); } if (!cannon.Fire()) { return(false); } return(true); }
/// <summary> /// Shots or not according to game mechanics constraints /// </summary> public bool TryFire() { if (!isMoving) // Won't shoot if not moving { return(false); } if (!HasShot) // Won't shoot if has "no ammo" { return(false); } if (!cannon.Fire()) { return(false); } hasShot = false; return(true); }