コード例 #1
0
ファイル: XmppHostBase.cs プロジェクト: micahlmartin/RPS-Xmpp
 protected virtual void ProcessTurnStartMessage(Jid from, TurnStartMessage turnStartMessage)
 {
 }
コード例 #2
0
        private void TurnStartedHandler(object sender, TurnStartEventArgs e)
        {
            var turnStartXml = new TurnStartMessage
            {
                GameId = e.GameInfo.GameId
            }.ToXml();

            Connection.Send(new Message(e.GameInfo.Player1, turnStartXml));
            Connection.Send(new Message(e.GameInfo.Player2, turnStartXml));
        }
コード例 #3
0
        protected override void ProcessTurnStartMessage(Jid from, TurnStartMessage turnStartMessage)
        {
            var move = _bots[turnStartMessage.GameId].MakeMove();

            var messageXml = new PlayerMoveMessage
            {
                GameId = turnStartMessage.GameId,
                Move = move.Name
            }.ToXml();

            Connection.Send(new Message(from, messageXml));

            base.ProcessTurnStartMessage(from, turnStartMessage);
        }