Пример #1
0
        private void HandleMissileMovement(Missile missile)
        {
            if (!missile.IsExploded)
            {
                var newLocation = _locationService.GetNewLocation(missile.Location, missile.MoveDirection);

                if (_locationService.IsLocationAvailableForMissile(newLocation) && _field.Bots.All(bot => bot.Location != missile.Location))
                {
                    missile.Location = newLocation;

                    if (!_gameConfig.IsFastMissileModeEnabled || _locationService.IsLocationAvailableForMissile(_locationService.GetNewLocation(newLocation, missile.MoveDirection)))
                    {
                        return;
                    }
                }

                SetExplosion(missile);
            }
        }
Пример #2
0
 public Missile(Missile missile)
     : base(missile)
 {
     MoveDirection = missile.MoveDirection;
 }
Пример #3
0
 public Missile(Missile missile) : base(missile)
 {
     MoveDirection = missile.MoveDirection;
 }