예제 #1
0
 public void MakeMoveToManager()
 {
     if (MoveToManager == null)
     {
         MoveToManager = MoveToManager.Create(PhysicsObj, WeenieObj);
     }
 }
예제 #2
0
        public MovementManager(PhysicsObj obj, WeenieObject wobj)
        {
            PhysicsObj = obj;
            WeenieObj  = wobj;

            MotionInterpreter = new MotionInterp(obj, wobj);
            MoveToManager     = new MoveToManager(obj, wobj);
        }
예제 #3
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);
            }
        }
예제 #4
0
        public static MoveToManager Create(PhysicsObj obj, WeenieObject wobj)
        {
            var moveToManager = new MoveToManager(obj, wobj);

            return(moveToManager);
        }