2025-06-30 21:49:33 +08:00
|
|
|
|
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;
|
|
|
|
|
}
|
2025-07-01 20:34:09 +08:00
|
|
|
|
|
|
|
|
|
public bool Equals(Structure other)
|
|
|
|
|
{
|
|
|
|
|
return Name.Equals(other.Name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return Name.GetHashCode();
|
|
|
|
|
}
|
2025-06-30 21:49:33 +08:00
|
|
|
|
}
|
|
|
|
|
}
|