コード例 #1
0
 private void UpdateFiringSolution(FiringSolution firingSolution, MissileAccelerationData missileAccelerationData, IShellstarModel shellstar)
 {
     FiringSolution   = firingSolution;
     AccelerationData = missileAccelerationData;
     Shellstar        = shellstar;
     LaunchWindows    = GetAvailableLaunchWindows();
     OnFiringSolutionUpdated();
 }
コード例 #2
0
 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);
            }
        }
コード例 #4
0
 public void Initialize(IShellstarModel shellstar, string targetName)
 {
     UnsubscribeFromEvents();
     _shellstarModel = shellstar;
     TargetName      = targetName;
     ResetImpulseTrack();
     OnNewShellstar();
     SubscribeToEvents();
 }
コード例 #5
0
ファイル: UnitModel.cs プロジェクト: jbarson/KineticsTool
        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);
        }
コード例 #8
0
        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();
        }
コード例 #9
0
        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
ファイル: UnitModel.cs プロジェクト: jbarson/KineticsTool
        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
ファイル: UnitModel.cs プロジェクト: jbarson/KineticsTool
 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);
 }