private IUnitModel GetUnit(SelectionSlot slot) { IUnitModel unit; _selectedUnits.TryGetValue(slot, out unit); return unit; }
/// <summary> /// Update selection. /// </summary> /// <param name="newUnit">Unit that will be added to selection or replace existing unit.</param> /// <param name="slot">Selection slot to update</param> public void UpdateSelectedUnit(IUnitModel newUnit, SelectionSlot slot) { _selectedUnits[slot] = newUnit; if (SelectionChanged != null) { SelectionChanged(slot, newUnit); } }
private IUnitModel GetUnit(SelectionSlot slot) { IUnitModel unit; _selectedUnits.TryGetValue(slot, out unit); return(unit); }
private void UnitSetupModelOnSelectionChanged(SelectionSlot slot, IUnitModel newUnit) { if (slot == Slot) { UnsubscribeFromEvents(); _selectedUnit = newUnit; PositionViewModel.SelectUnit(_selectedUnit); VectorsViewModel.SelectUnit(_selectedUnit); SubscribeToEvents(); OnNewUnitSelected(); UpdateShellstarInfo(); } else { OnPropertyChanged(Properties.CanFire); } }
public IUnitModel GetPair(SelectionSlot slot) { return slot == SelectionSlot.FirstUnit ? SecondUnit : FirstUnit; }
public void SelectUnit(SelectionSlot slot) { _unitSetupModel.UpdateSelectedUnit(_unitModel, slot); }
public IUnitModel GetPair(SelectionSlot slot) { return(slot == SelectionSlot.FirstUnit ? SecondUnit : FirstUnit); }