Exemple #1
0
 public IPlayer Create(IPlayerSlot slot)
 {
     return(new Player
     {
         Slot = slot
     });
 }
Exemple #2
0
 public IPaddle Create(IPlayerSlot playerSlot)
 {
     return(new Paddle
     {
         Position = playerSlot.SpawnPosition,
         Color = playerSlot.Color
     });
 }
Exemple #3
0
 public IPaddle Create(IPlayerSlot playerSlot)
 {
     return new Paddle
     {
         Position = playerSlot.SpawnPosition,
         Color = playerSlot.Color
     };
 }
Exemple #4
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);
            }
        }
Exemple #5
0
 public void Render(IPlayerSlot playerSlot)
 {
     fontRenderer.Render(playerSlot.Color, playerSlot.JoinReadyPosition, playerSlot.JoinReadyFontDrawFlags, playerSlot.Ready ? playerSlot.ReadyText : playerSlot.JoinText);
 }
Exemple #6
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);
     }
 }
Exemple #7
0
 public void Render(IPlayerSlot playerSlot)
 {
     fontRenderer.Render(playerSlot.Color, playerSlot.JoinReadyPosition, playerSlot.JoinReadyFontDrawFlags, playerSlot.Ready ? playerSlot.ReadyText : playerSlot.JoinText);
 }