Пример #1
0
        public WeenieError PerformMovement(MovementStruct mvs)
        {
            var result = WeenieError.None;

            switch (mvs.Type)
            {
            case MovementType.RawCommand:
                result = DoMotion(mvs.Motion, mvs.Params);
                break;

            case MovementType.InterpretedCommand:
                result = DoInterpretedMotion(mvs.Motion, mvs.Params);
                break;

            case MovementType.StopRawCommand:
                result = StopMotion(mvs.Motion, mvs.Params);
                break;

            case MovementType.StopInterpretedCommand:
                result = StopInterpretedMotion(mvs.Motion, mvs.Params);
                break;

            case MovementType.StopCompletely:
                result = StopCompletely();
                break;

            default:
                return(WeenieError.GeneralMovementFailure);
            }
            PhysicsObj.CheckForCompletedMotions();
            return(result);
        }
Пример #2
0
        public WeenieError PerformMovement(MovementStruct mvs)
        {
            CancelMoveTo(WeenieError.ActionCancelled);
            PhysicsObj.unstick_from_object();
            switch (mvs.Type)
            {
            case MovementType.MoveToObject:
                MoveToObject(mvs.ObjectId, mvs.TopLevelId, mvs.Radius, mvs.Height, mvs.Params);
                break;

            case MovementType.MoveToPosition:
                MoveToPosition(mvs.Position, mvs.Params);
                break;

            case MovementType.TurnToObject:
                TurnToObject(mvs.ObjectId, mvs.TopLevelId, mvs.Params);
                break;

            case MovementType.TurnToHeading:
                TurnToHeading(mvs.Params);
                break;
            }
            // server - movement/anim update
            return(WeenieError.None);
        }
Пример #3
0
        public Sequence PerformMovement(MovementStruct mvs)
        {
            Sequence sequence = null;

            switch (mvs.Type)
            {
            case MovementType.RawCommand:
                sequence = DoMotion(mvs.Motion, mvs.Params);
                break;

            case MovementType.InterpretedCommand:
                sequence = DoInterpretedMotion(mvs.Motion, mvs.Params);
                break;

            case MovementType.StopRawCommand:
                sequence = StopMotion(mvs.Motion, mvs.Params);
                break;

            case MovementType.StopInterpretedCommand:
                sequence = StopInterpretedMotion(mvs.Motion, mvs.Params);
                break;

            case MovementType.StopCompletely:
                sequence = StopCompletely();
                break;

            default:
                sequence.ID = 71;
                return(sequence);
            }
            PhysicsObj.CheckForCompletedMotions();
            return(sequence);
        }
Пример #4
0
        public WeenieError PerformMovement(MovementStruct mvs, Sequence seq)
        {
            if (Table == null)
            {
                return(WeenieError.NoAnimationTable);
            }

            uint counter = 0;

            switch (mvs.Type)
            {
            case MovementType.InterpretedCommand:
                if (!Table.DoObjectMotion(mvs.Motion, State, seq, mvs.Params.Speed, ref counter))
                {
                    return(WeenieError.NoMtableData);
                }

                add_to_queue(mvs.Motion, counter, seq);
                return(WeenieError.None);

            case MovementType.StopInterpretedCommand:
                if (!Table.StopObjectMotion(mvs.Motion, mvs.Params.Speed, State, seq, ref counter))
                {
                    return(WeenieError.NoMtableData);
                }

                add_to_queue((uint)MotionCommand.Ready, counter, seq);
                return(WeenieError.None);

            case MovementType.StopCompletely:
                Table.StopObjectCompletely(State, seq, ref counter);
                add_to_queue((uint)MotionCommand.Ready, counter, seq);
                return(WeenieError.None);

            default:
                return(WeenieError.None);       // ??
            }
        }
Пример #5
0
        public Sequence PerformMovement(MovementStruct mvs, Sequence seq)
        {
            if (Table == null)
            {
                return(new Sequence(0x7));
            }

            uint counter = 0;

            switch (mvs.Type)
            {
            case MovementType.InterpretedCommand:
                if (!Table.DoObjectMotion((uint)mvs.Motion, State, seq, mvs.Params.Speed, ref counter))
                {
                    return(new Sequence(0x43));
                }

                add_to_queue((uint)mvs.Motion, counter, seq);
                return(null);

            case MovementType.StopInterpretedCommand:
                if (!Table.StopObjectMotion((uint)mvs.Motion, mvs.Params.Speed, State, seq, ref counter))
                {
                    return(new Sequence(0x43));
                }

                add_to_queue(0x41000003, counter, seq);
                return(null);

            case MovementType.StopCompletely:
                Table.StopObjectCompletely(State, seq, ref counter);
                add_to_queue(0x41000003, counter, seq);
                return(null);;

            default:
                return(seq);
            }
        }
Пример #6
0
        public WeenieError PerformMovement(MovementStruct mvs)
        {
            PhysicsObj.set_active(true);

            switch (mvs.Type)
            {
            case MovementType.RawCommand:
            case MovementType.InterpretedCommand:
            case MovementType.StopRawCommand:
            case MovementType.StopInterpretedCommand:
            case MovementType.StopCompletely:

                if (MotionInterpreter == null)
                {
                    MotionInterpreter = MotionInterp.Create(PhysicsObj, WeenieObj);
                    if (PhysicsObj != null)
                    {
                        MotionInterpreter.enter_default_state();
                    }
                }
                return(MotionInterpreter.PerformMovement(mvs));

            case MovementType.MoveToObject:
            case MovementType.MoveToPosition:
            case MovementType.TurnToObject:
            case MovementType.TurnToHeading:

                if (MoveToManager == null)
                {
                    MoveToManager = MoveToManager.Create(PhysicsObj, WeenieObj);
                }

                return(MoveToManager.PerformMovement(mvs));

            default:
                return(WeenieError.GeneralMovementFailure);
            }
        }
Пример #7
0
        public Sequence PerformMovement(MovementStruct mvs)
        {
            CancelMoveTo(0x36);
            PhysicsObj.unstick_from_object();
            switch (mvs.Type)
            {
            case MovementType.MoveToObject:
                MoveToObject(mvs.ObjectId, mvs.TopLevelId, mvs.Radius, mvs.Height, mvs.Params);
                break;

            case MovementType.MoveToPosition:
                MoveToPosition(mvs.Position, mvs.Params);
                break;

            case MovementType.TurnToObject:
                TurnToObject(mvs.ObjectId, mvs.TopLevelId, mvs.Params);
                break;

            case MovementType.TurnToHeading:
                TurnToHeading(mvs.Params);
                break;
            }
            return(new Sequence(0));
        }
Пример #8
0
 public Sequence PerformMovement(MovementStruct mvs, Sequence sequence)
 {
     return(null);
 }
Пример #9
0
 public int PerformMovement(MovementStruct mvs)
 {
     return(-1);
 }