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

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

            return _compressor.Compress(payload);
        }
Beispiel #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;
        }
Beispiel #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);
        }