/// <summary> /// get waypoint or destination of specified type /// </summary> public Vector3D?getWayDest(TypeOfWayDest type) { switch (type) { case TypeOfWayDest.BLOCK: CurrentGridDest.throwIfNull_variable("CurrentGridDest"); return(CurrentGridDest.GetBlockPos()); case TypeOfWayDest.OFFSET: case TypeOfWayDest.LAND: CurrentGridDest.throwIfNull_variable("CurrentGridDest"); return(CurrentGridDest.GetBlockPos() + offsetToWorld()); case TypeOfWayDest.COORDINATES: return(coordDestination); case TypeOfWayDest.GRID: CurrentGridDest.throwIfNull_variable("CurrentGridDest"); return(CurrentGridDest.GetGridPos()); case TypeOfWayDest.WAYPOINT: return(myWaypoint); default: log("unknown type " + type, "getWayDest()", Logger.severity.ERROR); return(null); } }
/// <summary> /// removes one waypoint or centreDestination of the specified type /// </summary> /// <param name="typeToRemove"></param> public void atWayDest(TypeOfWayDest typeToRemove) { onWayDestAddedRemoved(); switch (typeToRemove) { case TypeOfWayDest.BLOCK: case TypeOfWayDest.COORDINATES: case TypeOfWayDest.GRID: case TypeOfWayDest.OFFSET: case TypeOfWayDest.LAND: log("clearing destination variables", "atWayDest()", Logger.severity.TRACE); CurrentGridDest = null; coordDestination = null; destination_offset = Vector3.Zero; match_direction = null; match_roll = null; landLocalBlock = null; landDirection = null; jump_to_dest = false; ignoreAsteroids = false; SpecialFlyingInstructions = SpecialFlying.None; goto case TypeOfWayDest.WAYPOINT; case TypeOfWayDest.WAYPOINT: myWaypoint = null; return; default: log("unknown type " + typeToRemove, "atWayDest()", Logger.severity.ERROR); return; } }