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()); }
private void HandleNameVote(NameVoteReceived e) { try { CharacterNameBiddings.SingleOrDefault(x => x.CharName.Id == e.CharName.Id)?.HandleNameVote(e); _dataStore.SaveData(CharacterNameBiddings.SelectMany(cnb => cnb.NameBids).ToList()); } catch (Exception exception) { _logger.LogError(exception, "Failed to record name vote and save."); } }
private void HandleNameRemoval(RemovingName e) { try { foreach (var charBidding in CharacterNameBiddings) { charBidding.TryRemove(e.NameToRemove); } _dataStore.SaveData(CharacterNameBiddings.SelectMany(cnb => cnb.NameBids).ToList()); } catch (Exception exception) { _logger.LogError(exception, "Failed to remove Name."); } }