public void AddOrUpdatePlayer(PlayerType player) { if (grda.Players.Contains(player)) { grda.Players.Remove(player); } grda.Players.Add(player); grda.SubmitPlayerListChanges(); }
private void ClearAllData(IGameRankingDataAccess DAL) { DAL.ClearAllData(); DAL.SubmitGameListChanges(); DAL.SubmitPlayerListChanges(); DAL.SubmitTeamListChanges(); DAL.SubmitmatchListChanges(); DAL.SubmitRankingListChanges(); }
/// <summary> /// Adds or updates a player /// </summary> /// <param name="player"> player </param> public void AddOrUpdatePlayer(PlayerType player) { if (player == null) { throw new System.InvalidOperationException("Player is null"); } if (backend.Players.Contains(player)) { backend.Players.Remove(player); } backend.Players.Add(player); backend.SubmitPlayerListChanges(); }