public static ILandscapeCursor MoveUntil(this ILandscapeCursor cursor, Vector3I moveVector, Predicate <byte> condition) { if (moveVector.IsZero()) { return(cursor); } while (!condition(cursor.Read())) { cursor.Move(moveVector); } return(cursor); }
/// <summary> /// Moves the cursor until the current block is equals to specified one (default 0) /// Maximum move length is 128 blocks /// Returns itself /// </summary> /// <param name="cursor"></param> /// <param name="moveVector"></param> /// <param name="blockId"></param> /// <returns></returns> public static ILandscapeCursor MoveUntil(this ILandscapeCursor cursor, Vector3I moveVector, byte blockId = 0) { if (moveVector.IsZero()) { return(cursor); } while (cursor.Read() != blockId) { cursor.Move(moveVector); } return(cursor); }