コード例 #1
0
        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);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
ファイル: XmppHostBase.cs プロジェクト: micahlmartin/RPS-Xmpp
 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
         });
 }
コード例 #4
0
ファイル: XmppHostBase.cs プロジェクト: micahlmartin/RPS-Xmpp
 protected virtual void ProcessTurnResultMessage(Jid from, TurnResultMessage turnResultMessage)
 {
     OnTurnCompleted(turnResultMessage);
 }