1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Minlib index additions

This commit is contained in:
Brian Fiete 2021-10-24 09:00:04 -07:00
parent 66eacca775
commit 1fd19c7672

View file

@ -3,6 +3,52 @@ using System.Diagnostics;
namespace System
{
enum Index
{
case FromFront(int offset);
case FromEnd(int offset);
}
struct IndexRange
{
public Index mStart;
public Index mEnd;
public bool mIsClosed;
public this()
{
this = default;
}
public this(Index start, Index end, bool isClosed=true)
{
mStart = start;
mEnd = end;
mIsClosed = isClosed;
}
public this(int start, Index end, bool isClosed=true)
{
mStart = .FromFront(start);
mEnd = end;
mIsClosed = isClosed;
}
public this(Index start, int end, bool isClosed=true)
{
mStart = start;
mEnd = .FromFront(end);
mIsClosed = isClosed;
}
public this(int start, int end, bool isClosed=true)
{
mStart = .FromFront(start);
mEnd = .FromFront(end);
mIsClosed = isClosed;
}
}
struct Range
{
protected int mStart;