EP 0.1.1
This commit is contained in:
34
Convention/[Symbolization]/Internal/Structure.cs
Normal file
34
Convention/[Symbolization]/Internal/Structure.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Convention.Symbolization.Internal
|
||||
{
|
||||
public sealed class Structure : Variable
|
||||
{
|
||||
public readonly string Name;
|
||||
private Dictionary<VariableSymbol, Variable> VariableSymbolAndDefaultValue;
|
||||
|
||||
private Structure(string name)
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
public Structure(string name, Dictionary<VariableSymbol, Variable> variableSymbolAndDefaultValue)
|
||||
{
|
||||
this.Name = name;
|
||||
this.VariableSymbolAndDefaultValue = variableSymbolAndDefaultValue;
|
||||
}
|
||||
|
||||
public override object Clone()
|
||||
{
|
||||
Structure target = new(Name);
|
||||
foreach (var pair in VariableSymbolAndDefaultValue)
|
||||
{
|
||||
target.VariableSymbolAndDefaultValue[pair.Key] = pair.Value;
|
||||
}
|
||||
return target;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user