protected override void ProcessTurnResultMessage(Jid from, TurnResultMessage turnResultMessage) { _bots[turnResultMessage.GameId].TurnResult(new TurnData { GameId = turnResultMessage.GameId, Player1Move = MoveFactory.GetMove(turnResultMessage.Player1Move), Player2Move = MoveFactory.GetMove(turnResultMessage.Player2Move), }); base.ProcessTurnResultMessage(from, turnResultMessage); }
private void TurnCompletedHandler(object sender, TurnCompletedEventArgs e) { var turnCompletedXml = new TurnResultMessage { Player1Move = e.TurnData.Player1Move.Name, Player2Move = e.TurnData.Player2Move.Name, Result = e.TurnData.Result, GameId = e.GameInfo.GameId }.ToXml(); Connection.Send(new Message(e.GameInfo.Player1, turnCompletedXml)); Connection.Send(new Message(e.GameInfo.Player2, turnCompletedXml)); }
private void OnTurnCompleted(TurnResultMessage turnResultMessage) { var turnCompletedEvent = TurnCompleted; if (turnCompletedEvent != null) turnCompletedEvent(this, new TurnCompletedReceivedEventArgs { GameId = turnResultMessage.GameId, Player1Move = turnResultMessage.Player1Move, Player2Move = turnResultMessage.Player2Move, Result = turnResultMessage.Result }); }
protected virtual void ProcessTurnResultMessage(Jid from, TurnResultMessage turnResultMessage) { OnTurnCompleted(turnResultMessage); }