Volian.Base.Library & Baseline
This commit is contained in:
@@ -6,7 +6,6 @@ using System.Xml.Serialization;
|
||||
namespace Volian.Base.Library
|
||||
{
|
||||
[Serializable()]
|
||||
//[XmlRoot("BigNum")]
|
||||
public class BigNum
|
||||
{
|
||||
#region fields
|
||||
@@ -22,19 +21,10 @@ namespace Volian.Base.Library
|
||||
public BigNum()
|
||||
{
|
||||
}
|
||||
public BigNum(int value)
|
||||
{
|
||||
SetFlag(value);
|
||||
}
|
||||
public BigNum(string values)
|
||||
{
|
||||
SetFlags(values);
|
||||
}
|
||||
public BigNum(ICollection<int> values)
|
||||
{
|
||||
SetFlags(values);
|
||||
}
|
||||
public override string ToString()
|
||||
public BigNum(int value) => SetFlag(value);
|
||||
public BigNum(string values) => SetFlags(values);
|
||||
public BigNum(ICollection<int> values) => SetFlags(values);
|
||||
public override string ToString()
|
||||
{
|
||||
return FlagList;
|
||||
}
|
||||
@@ -58,10 +48,6 @@ namespace Volian.Base.Library
|
||||
}
|
||||
#endregion
|
||||
#region methods
|
||||
//public override string ToString()
|
||||
//{
|
||||
// return GenericSerializer<BigNum>.StringSerialize(this);
|
||||
//}
|
||||
public bool Includes(BigNum other)
|
||||
{
|
||||
List<int> mine = GetFlags();
|
||||
@@ -82,12 +68,6 @@ namespace Volian.Base.Library
|
||||
public List<int> GetFlags()
|
||||
{
|
||||
List<int> myints = new List<int>();
|
||||
//if (MyValue.Count == 0)//1 && MyValue.ContainsKey(0) && MyValue[0] == 0)
|
||||
//{
|
||||
// myints.Add(-1);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
foreach (uint key in MyValue.Keys)
|
||||
{
|
||||
ulong y = MyValue[key];
|
||||
@@ -97,18 +77,10 @@ namespace Volian.Base.Library
|
||||
myints.Add((int)(i + (key * 64)));
|
||||
}
|
||||
}
|
||||
//}
|
||||
return myints;
|
||||
}
|
||||
public void SetFlag(int flag)
|
||||
{
|
||||
//if (flag == -1)
|
||||
//{
|
||||
// MyValue = new SortedDictionary<uint, ulong>();
|
||||
// //MyValue.Add(0, 0);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
uint offset = (uint)(flag / 64);
|
||||
ulong x = one << (flag % 64);
|
||||
if (MyValue.ContainsKey(offset))
|
||||
@@ -122,15 +94,10 @@ namespace Volian.Base.Library
|
||||
foreach (int f in flags)
|
||||
SetFlag(f);
|
||||
}
|
||||
public static BigNum MakeBigNum(string numbers)
|
||||
{
|
||||
if (numbers == "-1")
|
||||
return null;
|
||||
return new BigNum(numbers);
|
||||
}
|
||||
#endregion
|
||||
#region properties
|
||||
[XmlAttribute]
|
||||
public static BigNum MakeBigNum(string numbers) => numbers == "-1" ? null : new BigNum(numbers);
|
||||
#endregion
|
||||
#region properties
|
||||
[XmlAttribute]
|
||||
public string FlagList
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user