예제 #1
0
 private void UpdateFiringSolution(FiringSolution firingSolution, MissileAccelerationData missileAccelerationData, IShellstarModel shellstar)
 {
     FiringSolution   = firingSolution;
     AccelerationData = missileAccelerationData;
     Shellstar        = shellstar;
     LaunchWindows    = GetAvailableLaunchWindows();
     OnFiringSolutionUpdated();
 }
 public void Initialize(IShellstarModel shellstar, string targetName)
 {
     UnsubscribeFromEvents();
     _shellstarModel = shellstar;
     TargetName = targetName;
     ResetImpulseTrack();
     OnNewShellstar();
     SubscribeToEvents();
 }
예제 #3
0
        protected virtual void OnShellstarListChanged(ListAction action, IShellstarModel shellstar)
        {
            ShellstarListChangedDelegate handler = ShellstarListChanged;

            if (handler != null)
            {
                handler(action, shellstar);
            }
        }
 public void Initialize(IShellstarModel shellstar, string targetName)
 {
     UnsubscribeFromEvents();
     _shellstarModel = shellstar;
     TargetName      = targetName;
     ResetImpulseTrack();
     OnNewShellstar();
     SubscribeToEvents();
 }
예제 #5
0
        public void AttachShellstar(IShellstarModel shellstar)
        {
            if (_attachedShellstars.Contains(shellstar))
            {
                throw new ArgumentException(Resources.UnitModel_AttachShellstar_AlreadyExists, "shellstar");
            }

            _attachedShellstars.Add(shellstar);
            OnShellstarListChanged(ListAction.Added, shellstar);
        }
예제 #6
0
        public void DetachShellstar(IShellstarModel shellstar)
        {
            if (!_attachedShellstars.Contains(shellstar))
            {
                throw new ArgumentException(Resources.UnitModel_DetachShellstar_DoesNotExsit, "shellstar");
            }

            _attachedShellstars.Remove(shellstar);
            OnShellstarListChanged(ListAction.Removed, shellstar);
        }
예제 #7
0
        public void AttachShellstar(IShellstarModel shellstar)
        {
            if (_attachedShellstars.Contains(shellstar))
            {
                throw new ArgumentException(Resources.UnitModel_AttachShellstar_AlreadyExists, "shellstar");
            }

            _attachedShellstars.Add(shellstar);
            OnShellstarListChanged(ListAction.Added, shellstar);
        }
        public void Initialize(IUnitModel target, IShellstarModel shellstar, AvidWindow[] launchWindows)
        {
            UnsubscribeFromEvents();
            _target = target;
            _shellstar = shellstar;
            CanAttach = GetCanAttachShellstar();
            Caption = GetCaption();
            IsDataAvailable = GetIsDataAvailable();

            string targetName = _target != null ? _target.Name : string.Empty;
            _shellstarViewModel.Initialize(shellstar, targetName);
            _launchWindowControlViewModel.Initialize(_shellstar != null ? _shellstar.EvasionInfo : null, launchWindows);
            SubscribeToEvents();
        }
        public void Initialize(IUnitModel target, IShellstarModel shellstar, AvidWindow[] launchWindows)
        {
            UnsubscribeFromEvents();
            _target         = target;
            _shellstar      = shellstar;
            CanAttach       = GetCanAttachShellstar();
            Caption         = GetCaption();
            IsDataAvailable = GetIsDataAvailable();

            string targetName = _target != null ? _target.Name : string.Empty;

            _shellstarViewModel.Initialize(shellstar, targetName);
            _launchWindowControlViewModel.Initialize(_shellstar != null ? _shellstar.EvasionInfo : null, launchWindows);
            SubscribeToEvents();
        }
예제 #10
0
        private void Navigate(int newIndex)
        {
            _navigationIndex = Trim(newIndex, 0, _totalShellstars - 1);
            UpdateNavigationControls();
            UpdateCounterText();
            _selectedShellstar = _unit != null && _totalShellstars > 0 ? _attachedShellstars[_navigationIndex] : null;

            if (_unit != null)
            {
                _shellstarInfo.Initialize(_selectedShellstar, _unit.Name);
            }

            OnPropertyChanged(Properties.Tag);
            OnPropertyChanged(Properties.IsShellstarSelected);
        }
예제 #11
0
        public void CalculateFiringSolution()
        {
            var firingSolution = _firingSolutionCalculator.CalculateSolution(
                CourseOffset,
                CrossingVector.Magnitude,
                WeaponSelection.MuzzleVelocityMultiplyer,
                WeaponSelection.Acceleration);

            MissileAccelerationData missileAccelerationData = null;

            if (WeaponSelection.IsMissile && firingSolution.AimAdjustment != AimAdjustment.NoShot)
            {
                missileAccelerationData = _firingSolutionCalculator.CalculateMissileAcceleration(
                    TargetDistance.Magnitude,
                    WeaponSelection.MuzzleVelocityMultiplyer,
                    WeaponSelection.Acceleration,
                    firingSolution.AimAdjustment,
                    firingSolution.RoC);
            }

            IShellstarModel shellstar = BuildShellstar(firingSolution, missileAccelerationData);

            UpdateFiringSolution(firingSolution, missileAccelerationData, shellstar);
        }
예제 #12
0
 private void SelectedUnitOnShellstarListChanged(ListAction action, IShellstarModel affectedShellstar)
 {
     UpdateShellstarInfo();
 }
예제 #13
0
        public void DetachShellstar(IShellstarModel shellstar)
        {
            if (!_attachedShellstars.Contains(shellstar))
            {
                throw new ArgumentException(Resources.UnitModel_DetachShellstar_DoesNotExsit, "shellstar");
            }

            _attachedShellstars.Remove(shellstar);
            OnShellstarListChanged(ListAction.Removed, shellstar);
        }
예제 #14
0
 private void UpdateFiringSolution(FiringSolution firingSolution, MissileAccelerationData missileAccelerationData, IShellstarModel shellstar)
 {
     FiringSolution = firingSolution;
     AccelerationData = missileAccelerationData;
     Shellstar = shellstar;
     LaunchWindows = GetAvailableLaunchWindows();
     OnFiringSolutionUpdated();
 }
예제 #15
0
 protected virtual void OnShellstarListChanged(ListAction action, IShellstarModel shellstar)
 {
     ShellstarListChangedDelegate handler = ShellstarListChanged;
     if (handler != null)
     {
         handler(action, shellstar);
     }
 }
예제 #16
0
 private void UnitModelOnShellstarListChanged(ListAction action, IShellstarModel affectedShellstar)
 {
     OnPropertyChanged(Properties.CanViewShellstars);
 }
예제 #17
0
 private void SelectedUnitOnShellstarListChanged(ListAction action, IShellstarModel affectedShellstar)
 {
     UpdateShellstarInfo();
 }
예제 #18
0
        private void Navigate(int newIndex)
        {
            _navigationIndex = Trim(newIndex, 0, _totalShellstars - 1);
            UpdateNavigationControls();
            UpdateCounterText();
            _selectedShellstar = _unit != null && _totalShellstars > 0 ? _attachedShellstars[_navigationIndex] : null;

            if (_unit != null)
            {
                _shellstarInfo.Initialize(_selectedShellstar, _unit.Name);
            }

            OnPropertyChanged(Properties.Tag);
            OnPropertyChanged(Properties.IsShellstarSelected);
        }
예제 #19
0
 private void UnitOnShellstarListChanged(ListAction action, IShellstarModel affectedShellstar)
 {
     OnShellstarListChanged();
     Navigate(_navigationIndex);
 }
예제 #20
0
 private void UnitModelOnShellstarListChanged(ListAction action, IShellstarModel affectedShellstar)
 {
     OnPropertyChanged(Properties.CanViewShellstars);
 }
예제 #21
0
 private void UnitOnShellstarListChanged(ListAction action, IShellstarModel affectedShellstar)
 {
     OnShellstarListChanged();
     Navigate(_navigationIndex);
 }