Пример #1
0
 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);
 }
Пример #2
0
 public Shooting(BulletFactory bulletFactory)
 {
     _bulletFactory = bulletFactory;
     _bullet        = bulletFactory.Create();
 }