Exemple #1
0
        public void Join(IPlayerSlot playerSlot)
        {
            if (playerSlot.Ready)
            {
                return;
            }
            var wasStarted = HasStarted;

            playerSlot.Join(playerFactory.Create(playerSlot));
            if (!wasStarted && HasStarted)
            {
                foreach (var player in Players)
                {
                    playerInitializer.Initialize(player);
                }
                Ball = ballFactory.Create(new Point(Width / 2, Height / 2));
                ballInitializer.Initialize(Ball);
            }
        }