예제 #1
0
        public void AddPlayer(Player player)
        {
            if (CountPlayer > MAX_PLAYER_COUNT)
            {
                throw new ArgumentException("Nelze vložit dalšího hráče!");
            }


            players[CountPlayer++] = player;

            OnChangeCountPlayers?.Invoke(this, new OriginalCountPlayersEventArgs(CountPlayer - 1));
        }
예제 #2
0
        public void RemovePlayer(int index)
        {
            if (index < 0 || index > CountPlayer)
            {
                throw new ArgumentException("Neplatný index!");
            }

            players[index] = null;
            reorganizePlayers();

            OnChangeCountPlayers?.Invoke(this, new OriginalCountPlayersEventArgs(CountPlayer + 1));
        }