Esempio n. 1
0
        public Player ConnectPlayer(PlayerEventHandler eventHandler, string id)
        {
            var player = Players.Find(p => p.Id.ToString() == id);

            if (player != null)
            {
                player.EventHandler = eventHandler;
            }

            return(player);
        }
Esempio n. 2
0
        public Player AddPlayer(PlayerEventHandler eventHandler)
        {
            var player = new Player
            {
                EventHandler = eventHandler,
                Color        = GetUnusedColor()
            };

            Players.Add(player);
            OnPlayersChange?.Invoke();
            return(player);
        }