public void Reset() { CharacterNameBiddings.Clear(); foreach (CharNames charName in CharNames.Core) { CharacterNameBiddings.Add(new CharacterNameBidding(charName, _charNameBiddingLogger)); } _dataStore.SaveData(CharacterNameBiddings.SelectMany(cnb => cnb.NameBids).ToList()); HandleNameRefresh(new RefreshEvent()); }
public void Load(List <CharacterNameBid> nameBids) { CharacterNameBiddings.Clear(); foreach (CharNames charName in CharNames.Core) { var nameBidding = new CharacterNameBidding(charName, _charNameBiddingLogger, false); var namesForChar = nameBids.Where(x => x.CharNameId == charName.Id) .OrderByDescending(x => x.TotalBits); foreach (var nameBid in namesForChar) { nameBidding.NameBids.Add(nameBid); } if (nameBidding.NameBids.Count == 0) { nameBidding.AddDefaultRecord(); } CharacterNameBiddings.Add(nameBidding); } }