40 lines
950 B
C#
40 lines
950 B
C#
using System.Collections.Generic;
|
|
|
|
namespace Pf2e.WPF.EntityViewer.EntityViewStructure;
|
|
|
|
/// <summary>
|
|
/// Класс для хранения обработанного объекта.
|
|
/// </summary>
|
|
/// <param name="value">Объект.</param>
|
|
internal class StructureProcessedObject(object value)
|
|
{
|
|
public readonly object Value = value;
|
|
|
|
private StructureFieldComplex? _field;
|
|
|
|
public StructureFieldComplex? Field
|
|
{
|
|
get => _field;
|
|
set
|
|
{
|
|
_field = value;
|
|
foreach (StructureFieldReference reference in _references)
|
|
{
|
|
reference.Reference = Field;
|
|
}
|
|
}
|
|
}
|
|
|
|
private readonly List<StructureFieldReference> _references = [];
|
|
|
|
public void AddReference(StructureFieldReference reference)
|
|
{
|
|
_references.Add(reference);
|
|
|
|
if (_field is not null)
|
|
{
|
|
reference.Reference = Field;
|
|
}
|
|
}
|
|
}
|