Example #1
0
        public bool AddMoveIfNew(Move inMove)
        {
            //we might have already received this move in another packet ( since we're sending the same move in multiple packets )
            //so make sure it's new...

            //adjust the deltatime and then place!
            float timeStamp = inMove.GetTimestamp();

            if (timeStamp > mLastMoveTimestamp)
            {
                float deltaTime = mLastMoveTimestamp >= 0.0f ? timeStamp - mLastMoveTimestamp : 0.0f;

                mLastMoveTimestamp = timeStamp;

                mMoves.Add(new Move(inMove.GetInputState(), timeStamp, deltaTime));
                return(true);
            }

            return(false);
        }