Added constructors from List<T>.

This commit is contained in:
2017-06-08 19:05:35 +01:00
parent 8e639f379a
commit 4a285dd623
8 changed files with 40 additions and 0 deletions

View File

@@ -44,6 +44,11 @@ namespace Extents
backend = new List<Tuple<byte, byte>>(); backend = new List<Tuple<byte, byte>>();
} }
public ExtentsByte(List<Tuple<byte, byte>> list)
{
backend = list.OrderBy(t => t.Item1).ToList();
}
public int Count { get { return backend.Count; } } public int Count { get { return backend.Count; } }
public void Add(byte item) public void Add(byte item)

View File

@@ -44,6 +44,11 @@ namespace Extents
backend = new List<Tuple<int, int>>(); backend = new List<Tuple<int, int>>();
} }
public ExtentsInt(List<Tuple<int, int>> list)
{
backend = list.OrderBy(t => t.Item1).ToList();
}
public int Count { get { return backend.Count; } } public int Count { get { return backend.Count; } }
public void Add(int item) public void Add(int item)

View File

@@ -44,6 +44,11 @@ namespace Extents
backend = new List<Tuple<long, long>>(); backend = new List<Tuple<long, long>>();
} }
public ExtentsLong(List<Tuple<long, long>> list)
{
backend = list.OrderBy(t => t.Item1).ToList();
}
public int Count { get { return backend.Count; } } public int Count { get { return backend.Count; } }
public void Add(long item) public void Add(long item)

View File

@@ -44,6 +44,11 @@ namespace Extents
backend = new List<Tuple<sbyte, sbyte>>(); backend = new List<Tuple<sbyte, sbyte>>();
} }
public ExtentsSByte(List<Tuple<sbyte, sbyte>> list)
{
backend = list.OrderBy(t => t.Item1).ToList();
}
public int Count { get { return backend.Count; } } public int Count { get { return backend.Count; } }
public void Add(sbyte item) public void Add(sbyte item)

View File

@@ -44,6 +44,11 @@ namespace Extents
backend = new List<Tuple<short, short>>(); backend = new List<Tuple<short, short>>();
} }
public ExtentsShort(List<Tuple<short, short>> list)
{
backend = list.OrderBy(t => t.Item1).ToList();
}
public int Count { get { return backend.Count; } } public int Count { get { return backend.Count; } }
public void Add(short item) public void Add(short item)

View File

@@ -44,6 +44,11 @@ namespace Extents
backend = new List<Tuple<uint, uint>>(); backend = new List<Tuple<uint, uint>>();
} }
public ExtentsUInt(List<Tuple<uint, uint>> list)
{
backend = list.OrderBy(t => t.Item1).ToList();
}
public int Count { get { return backend.Count; } } public int Count { get { return backend.Count; } }
public void Add(uint item) public void Add(uint item)

View File

@@ -44,6 +44,11 @@ namespace Extents
backend = new List<Tuple<ulong, ulong>>(); backend = new List<Tuple<ulong, ulong>>();
} }
public ExtentsULong(List<Tuple<ulong, ulong>> list)
{
backend = list.OrderBy(t => t.Item1).ToList();
}
public int Count { get { return backend.Count; } } public int Count { get { return backend.Count; } }
public void Add(ulong item) public void Add(ulong item)

View File

@@ -44,6 +44,11 @@ namespace Extents
backend = new List<Tuple<ushort, ushort>>(); backend = new List<Tuple<ushort, ushort>>();
} }
public ExtentsUShort(List<Tuple<ushort, ushort>> list)
{
backend = list.OrderBy(t => t.Item1).ToList();
}
public int Count { get { return backend.Count; } } public int Count { get { return backend.Count; } }
public void Add(ushort item) public void Add(ushort item)