예제 #1
0
        private void DeleteMatchRecieved(Match match)
        {
            var newMatches = State.Matches.ToList();

            newMatches.RemoveAll(x => x.Guid == match.Guid);
            State.Matches = newMatches.ToArray();
            NotifyPropertyChanged(nameof(State));

            MatchDeleted?.Invoke(match);
        }
예제 #2
0
        private void DeleteMatchReceived(Match match)
        {
            // TODO: This is garbage
            var newMatches = State.Matches.ToList();

            newMatches.RemoveAll(x => x.Guid == match.Guid);
            State.Matches.Clear();
            State.Matches.AddRange(newMatches);
            NotifyPropertyChanged(nameof(State));

            MatchDeleted?.Invoke(match);
        }
예제 #3
0
        public void DeleteMatch(Match match)
        {
            lock (State)
            {
                var newMatches = State.Matches.ToList();
                newMatches.RemoveAll(x => x.Guid == match.Guid);
                State.Matches = newMatches.ToArray();
            }

            NotifyPropertyChanged(nameof(State));

            var @event = new Event();

            @event.Type          = Event.EventType.MatchDeleted;
            @event.ChangedObject = match;
            BroadcastToAllClients(new Packet(@event));

            MatchDeleted?.Invoke(match);
        }