Ejemplo n.º 1
0
 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());
 }
Ejemplo n.º 2
0
 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.");
     }
 }
Ejemplo n.º 3
0
 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.");
     }
 }