Example #1
0
        private void OnSelectHand(BinaryReader packet)
        {
            int result;

            if (_hand > 0)
            {
                result = _hand;
            }
            else
            {
                result = _ai.OnRockPaperScissors();
            }
            Connection.Send(CtosMessage.HandResult, (byte)result);
        }
Example #2
0
        private void OnRockPaperScissors(BinaryReader packet)
        {
            packet.ReadByte(); // player
            int result;

            if (_hand > 0)
            {
                result = _hand;
            }
            else
            {
                result = _ai.OnRockPaperScissors();
            }
            Connection.Send(CtosMessage.Response, result);
        }