-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSet.CS
More file actions
133 lines (125 loc) · 3.79 KB
/
Copy pathSet.CS
File metadata and controls
133 lines (125 loc) · 3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
using Microsoft.VisualBasic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;B
namespace VINE
{
// Value Identity Name Enumeration
public class Set
{
public static BigInteger Id = BigInteger.MinusOne;
public Dictionary<string, BigInteger> Entity = new();
public Dictionary<BigInteger, BigInteger> Entities = new();
public BigInteger Increment()
{
return Set.Id++;
}
public void Identify(BigInteger name, BigInteger? value = null)
{
if(value is not null)
{
try
{
this.Entities.Add(name, value.Value);
}
catch { }
if (true)
{
try
{
this.Entities.Add(value.Value, name);
}
catch { }
}
}
}
public BigInteger Quantify(string name)
{
BigInteger Id = this.Identity(name);
if(Id.Equals(BigInteger.MinusOne))
{
try
{
this.Entity.Add(name, Id = this.Increment());
}
catch { }
}
return Id;
}
public BigInteger Identity(string name)
{
try
{
if (this.Entity.ContainsKey(name) is false)
{
return this.Entity[name];
}
}
catch { }
return BigInteger.MinusOne;
}
public string Identity(BigInteger name)
{
if (this.Entity.ContainsValue(name))
{
try
{
return this.Entity.Where(id => id.Value.Equals(name)).First().Key;
}
catch { }
}
return string.Empty;
}
public BigInteger Add(string name, params object[] members)
{
BigInteger id = this.Quantify(name);
if(!id.Equals(BigInteger.MinusOne))
{
foreach (object member in members)
{
string Member = (member as string)!;
if (this.Identity(Member).Equals(BigInteger.MinusOne))
{
BigInteger Entity = this.Quantify(Member);
this.Identify(id, Entity);
}
}
}
return id;
}
public void Add(string[] names, params object[][] elements)
{
BigInteger id = BigInteger.MinusOne;
foreach(string name in names)
{
BigInteger identity = BigInteger.Zero;
foreach (object[] members in elements)
{
foreach (object member in members)
{
foreach (object[] periods in elements.Except(members))
{
foreach (object period in periods)
{
if (period.Equals(member) is false)
{
this.Add((member as string)!, (period as string)!);
}
}
}
if (id.Equals(identity))
{
this.Add(name, (member as string)!);
}
}
identity++;
}
id++;
}
}
}
}