public override bool Equals(object obj) { ItemViewModelWinningsEntry other = (ItemViewModelWinningsEntry)obj; if (other != null) { return(Symbol == other.Symbol && Count == other.Count); } return(false); }
public ViewModelWinningsSetup( List <IPropertySource> propertySources, ILogicWinningsSetup logicWinningsSetup, TickScale tickScale) : base(propertySources) { _logicWinningsSetup = logicWinningsSetup; _tickScale = tickScale; _entry = null; _winList = new ObservableCollection <ItemViewModelWinningsEntry>(); _winListCopy = null; }
/// <summary> /// Update the winnings entry corresponding to the specified wheel symbols. /// </summary> private void UpdateItem(WheelSymbolCount wsCount, int newWinnings) { ItemViewModelWinningsEntry entry = new ItemViewModelWinningsEntry(wsCount, newWinnings); for (int index = 0; index < _winList.Count; index++) { if (_winList[index].Equals(entry)) { // We found the matching entry, so update it by deleting // and re-inserting with the updated winnings amount. _winList.RemoveAt(index); _winList.Insert(index, entry); return; } } }