SadConsole.Consoles.Cursor.RightWrap C# (CSharp) Method

RightWrap() public method

Moves the cusor right by the specified amount of columns, wrapping the cursor if needed.
public RightWrap ( int amount ) : Cursor
amount int The amount of columns to move the cursor
return Cursor
        public Cursor RightWrap(int amount)
        {
            var console = ((SurfaceEditor)_console.Target);

            int index = TextSurface.GetIndexFromPoint(this._position, console.TextSurface.Width) + amount;

            if (index > console.TextSurface.Cells.Length)
                index = console.TextSurface.Cells.Length - 1;

            this._position = TextSurface.GetPointFromIndex(index, console.TextSurface.Width);

            return this;
        }