/// <summary> /// Constructor /// </summary> /// <param name="items"> /// The item dictionary. /// </param> /// <param name="prizes"> /// The prize dictionary. /// </param> public CrystalRequirement(IItemDictionary items, IPrizeDictionary prizes) { _gtCrystal = (ICrystalRequirementItem)items[ItemType.TowerCrystals]; _crystal = prizes[PrizeType.Crystal]; _redCrystal = prizes[PrizeType.RedCrystal]; _gtCrystal.PropertyChanged += OnItemChanged; _crystal.PropertyChanged += OnItemChanged; _redCrystal.PropertyChanged += OnItemChanged; UpdateValue(); }
/// <summary> /// Constructor /// </summary> /// <param name="colorSettings"> /// The color settings data. /// </param> /// <param name="undoRedoManager"> /// The undo/redo manager. /// </param> /// <param name="undoableFactory"> /// The factory for creating undoable actions. /// </param> /// <param name="imageSource"> /// A string representing the image source. /// </param> /// <param name="item"> /// An item that is to be represented by this control. /// </param> public CrystalRequirementLargeItemVM( IColorSettings colorSettings, IUndoRedoManager undoRedoManager, IUndoableFactory undoableFactory, ICrystalRequirementItem item, string imageSource) { _colorSettings = colorSettings; _undoRedoManager = undoRedoManager; _undoableFactory = undoableFactory; _item = item; ImageSource = imageSource; HandleClick = ReactiveCommand.Create <PointerReleasedEventArgs>(HandleClickImpl); _item.PropertyChanged += OnItemChanged; _colorSettings.PropertyChanged += OnColorsChanged; _colorSettings.AccessibilityColors.PropertyChanged += OnColorsChanged; }
/// <summary> /// Constructor /// </summary> /// <param name="item"> /// The crystal requirement to be added. /// </param> public AddCrystalRequirement(ICrystalRequirementItem item) { _item = item ?? throw new ArgumentNullException(nameof(item)); }
/// <summary> /// Returns a new remove crystal requirement action. /// </summary> /// <param name="item"> /// The crystal requirement to be removed. /// </param> /// <returns> /// A new remove crystal requirement action. /// </returns> public IUndoable GetRemoveCrystalRequirement(ICrystalRequirementItem item) { return(_removeCrystalRequirementFactory(item)); }
/// <summary> /// Returns a new add crystal requirement action. /// </summary> /// <param name="item"> /// The crystal requirement item. /// </param> /// <returns> /// A new add crystal requirement action. /// </returns> public IUndoable GetAddCrystalRequirement(ICrystalRequirementItem item) { return(_addCrystalFactory(item)); }