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:
parent
66eacca775
commit
1fd19c7672
1 changed files with 46 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue