public void Decorate(GameInviteReceivedServerMessage gameInviteNotification, IGameSession session) { var sessionPlayer1 = session.Player1 as GuessMyNumberPlayer; gameInviteNotification.AdditionalInformation = sessionPlayer1.Number.ToString(); }
public void Decorate(GameInviteReceivedServerMessage gameInviteNotification, IGameSession session) { return; }
private void HandleCreateGame(ClientContract clientContract) { var createGameClientMessage = this.serializer.Deserialize<CreateGameClientMessage>(clientContract.SerializedClientMessage); var connectedPlayer1 = this.userService.GetByName(createGameClientMessage.UserName); var sessionPlayer1 = this.sessionPlayerFactory.Create(connectedPlayer1); var connectedPlayer2 = this.userService.GetByName(createGameClientMessage.InvitedUserName); var sessionPlayer2 = this.sessionPlayerFactory.Create(connectedPlayer2); this.sessionPlayerSetup.GetPlayerReady(createGameClientMessage, sessionPlayer1); var newSession = this.sessionService.Create(sessionPlayer1, sessionPlayer2); var gameInviteReceivedServerMessage = new GameInviteReceivedServerMessage { SessionName = newSession.Name, Player1Name = newSession.Player1Name }; this.gameInviteDecorator.Decorate(gameInviteReceivedServerMessage, newSession); this.notificationService.Send(GamifyServerMessageType.GameInviteReceived, gameInviteReceivedServerMessage, newSession.Player2Name); }