예제 #1
0
        public void Remove(Fußballer fußballer)
        {
            if (fußballer == null || !_mannschaft.Contains(fußballer))
            {
                return;
            }

            if (fußballer.Team == this)
            {
                fußballer.Team = null;
            }

            _mannschaft.Remove(fußballer);
        }
예제 #2
0
        public void Add(Fußballer fußballer)
        {
            if (fußballer == null)
            {
                throw new ArgumentNullException(nameof(fußballer));
            }

            if (fußballer.Team != null)
            {
                fußballer.Team = null;
            }

            _mannschaft.Add(fußballer);
        }