private void RemoveRequest(UserJoinToServerRequest request) { if (_requests.Remove(request) && this.OnRequestRemoved != null) { this.OnRequestRemoved(request); } }
private void RemoveRequest(UserJoinToServerRequest request) { if (!this._requests.Remove(request) || this.OnRequestRemoved == null) { return; } this.OnRequestRemoved(request); }
private void RemoveRequestAtIndex(int i) { UserJoinToServerRequest request = _requests[i]; _requests.RemoveAt(i); if (this.OnRequestRemoved != null) { this.OnRequestRemoved(request); } }
private void RemoveRequestAtIndex(int i) { UserJoinToServerRequest request = this._requests[i]; this._requests.RemoveAt(i); if (this.OnRequestRemoved == null) { return; } this.OnRequestRemoved(request); }
public void Add(UserJoinToServerRequest request) { for (int i = this._requests.Count - 1; i >= 0; --i) { if (this._requests[i].Equals((object)request)) { this.RemoveRequestAtIndex(i); } } this._requests.Add(request); request.OnAccepted += (Action)(() => this.RemoveRequest(request)); request.OnRejected += (Action)(() => this.RemoveRequest(request)); if (this.OnRequestAdded == null) { return; } this.OnRequestAdded(request); }
public void Add(UserJoinToServerRequest request) { for (int num = _requests.Count - 1; num >= 0; num--) { if (_requests[num].Equals(request)) { RemoveRequestAtIndex(num); } } _requests.Add(request); request.OnAccepted += delegate { RemoveRequest(request); }; request.OnRejected += delegate { RemoveRequest(request); }; if (this.OnRequestAdded != null) { this.OnRequestAdded(request); } }