Exemplo n.º 1
0
        public unsafe void TouchDataParser(byte[] bufferArray,POIRealtimeMsgCB cb)
        {
            fixed (byte* bytePointer = bufferArray)
            {
                byte* touchData = bytePointer;
                TouchPhase* touchPhase = (TouchPhase*)touchData;
                if (*touchPhase == TouchPhase.TOUCH_BEGIN)
                {
                    //Console.Write("Begin\n");
                    touchData += sizeof(TouchPhase);
                    //TouchBeginParser(touchData);
                    cb.Handle_TouchBegin(touchData);
                }
                else if (*touchPhase == TouchPhase.TOUCH_MOVE)
                {
                    //Console.Write("Move\n");
                    touchData += sizeof(TouchPhase);
                    //TouchMoveParser(touchData);
                    cb.Handle_TouchMove(touchData);
                }

                else if (*touchPhase == TouchPhase.TOUCH_END)
                {
                    //Console.Write("End\n");
                    touchData += sizeof(TouchPhase);
                    //TouchEndParser(touchData);
                    cb.Handle_TouchEnd(touchData);
                }

            }
        }