public bool Fire(int x, int y) { if (DateTime.Now - _shootTime > _timeToNextShot) { Bullet bullet = _bulletFactory.Create(); bullet.Fire(x, y); _bullets.Add(bullet); _shootTime = DateTime.Now; return(true); } return(false); }
public Shooting(BulletFactory bulletFactory) { _bulletFactory = bulletFactory; _bullet = bulletFactory.Create(); }