public static void RemoveUser(RiotUser user) { if (user.IsValid() == false) { throw new WebResponseException((int)WebResponseStatusCode.Invalid, $"UserManager.RemoveUser - Invalid User. {user}"); } lock (mUsers) { if (mUsers.Contains(user) == false) { throw new WebResponseException((int)WebResponseStatusCode.NotFound, $"UserManager.RemoveUser - Not Found User. {user}"); } mUsers.Remove(user); } }
public static void AddUser(RiotUser user) { if (user.IsValid() == false) { throw new WebResponseException((int)WebResponseStatusCode.Invalid, $"UserManager.AddUser - Invalid User. {user}"); } lock (mUsers) { if (mUsers.Contains(user)) { throw new WebResponseException((int)WebResponseStatusCode.AlreadyAdded, $"UserManager.AddUser - This user has already been added. {user}"); } mUsers.Add(user); } }