Esempio n. 1
0
        public static object[] BuildCollisionPayload(Cycle cycle)
        {
            CollisionPayload payload = new CollisionPayload
            {
                ID         = cycle.ID,
                CollidedAt = cycle.MovementController.Position
            };

            return(_compressor.Compress(payload));
        }
Esempio n. 2
0
        public static object[] BuildCollisionPayload(Cycle cycle)
        {
            CollisionPayload payload = new CollisionPayload
            {
                ID = cycle.ID,
                CollidedAt = cycle.MovementController.Position
            };

            return _compressor.Compress(payload);
        }
Esempio n. 3
0
        public object[] Compress(CollisionPayload payload)
        {
            object[] result = new object[4];

            result[_collisionCompressionContract.ID] = payload.ID;
            result[_collisionCompressionContract.CollidedAt_X] = Math.Round(payload.CollidedAt.x, 2);
            result[_collisionCompressionContract.CollidedAt_Y] = Math.Round(payload.CollidedAt.y, 2);
            result[_collisionCompressionContract.CollidedAt_Z] = Math.Round(payload.CollidedAt.z, 2);

            return result;
        }
Esempio n. 4
0
        public object[] Compress(CollisionPayload payload)
        {
            object[] result = new object[4];

            result[_collisionCompressionContract.ID]           = payload.ID;
            result[_collisionCompressionContract.CollidedAt_X] = Math.Round(payload.CollidedAt.x, 2);
            result[_collisionCompressionContract.CollidedAt_Y] = Math.Round(payload.CollidedAt.y, 2);
            result[_collisionCompressionContract.CollidedAt_Z] = Math.Round(payload.CollidedAt.z, 2);

            return(result);
        }