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