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(); }
protected virtual void OnShellstarListChanged(ListAction action, IShellstarModel shellstar) { ShellstarListChangedDelegate handler = ShellstarListChanged; if (handler != null) { handler(action, shellstar); } }
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 DetachShellstar(IShellstarModel shellstar) { if (!_attachedShellstars.Contains(shellstar)) { throw new ArgumentException(Resources.UnitModel_DetachShellstar_DoesNotExsit, "shellstar"); } _attachedShellstars.Remove(shellstar); OnShellstarListChanged(ListAction.Removed, 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(); }
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); }
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); }
private void SelectedUnitOnShellstarListChanged(ListAction action, IShellstarModel affectedShellstar) { UpdateShellstarInfo(); }
private void UnitModelOnShellstarListChanged(ListAction action, IShellstarModel affectedShellstar) { OnPropertyChanged(Properties.CanViewShellstars); }
private void UnitOnShellstarListChanged(ListAction action, IShellstarModel affectedShellstar) { OnShellstarListChanged(); Navigate(_navigationIndex); }