public void MakeMoveToManager() { if (MoveToManager == null) { MoveToManager = MoveToManager.Create(PhysicsObj, WeenieObj); } }
public MovementManager(PhysicsObj obj, WeenieObject wobj) { PhysicsObj = obj; WeenieObj = wobj; MotionInterpreter = new MotionInterp(obj, wobj); MoveToManager = new MoveToManager(obj, wobj); }
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); } }
public static MoveToManager Create(PhysicsObj obj, WeenieObject wobj) { var moveToManager = new MoveToManager(obj, wobj); return(moveToManager); }