Class FoundationReferenceFieldGraph
Reads, by reflection, every serialized string field an IFoundationSettings asset type
holds — including the fields of serializable classes nested in it and of arrays/lists of them — and
which of those carry a FoundationIdReferenceAttribute. Engine-agnostic: Unity's
serialization rules are recognised by attribute NAME, so this compiles and runs without a UnityEngine
reference. FoundationReferenceContracts is the declared subset of this graph; the
completeness ratchet walks the whole of it.
A polymorphic [SerializeReference] member (a signal list, an effect list) is read as every
concrete serializable subtype of its declared type, all under the member's own path: the walker finds
the one that is actually stored there by the property name. A serializable class already on the path
being walked (a recursive tree) is visited once, at its first level.
Inheritance
FoundationReferenceFieldGraph
Assembly: Serenity.Global.Application.dll
Syntax
public static class FoundationReferenceFieldGraph
Properties
AllFields
Every string field of every owner type, in a stable order.
Declaration
public static IReadOnlyList<FoundationStringField> AllFields { get; }
Property Value
DeclaredFields
Every declared reference field, i.e. AllFields narrowed to declarations.
Declaration
public static IEnumerable<FoundationStringField> DeclaredFields { get; }
Property Value
FieldCollectionFailures
One line per owner type that could not be read (a type that fails to load, an attribute
from a missing assembly) and was left out of AllFields — empty when every type was
read. The caller that has a log reports them; the graph itself has none.
Declaration
public static IReadOnlyList<string> FieldCollectionFailures { get; }
Property Value
MisplacedDeclarations
One line per field carrying FoundationIdReferenceAttribute that the graph
cannot read as a string — a declaration that would otherwise silently do nothing.
Declaration
public static IReadOnlyList<string> MisplacedDeclarations { get; }
Property Value
OwnerTypes
Every type that can own a foundation reference: each loaded class implementing
IFoundationSettings that is a UnityEngine object (a ScriptableObject asset or a prefab
component — a plain class implementing it is only ever nested inside one, or a runtime object that is
never an asset) and each base class up its chain, since a field is owned by the type that declares it.
Declaration
public static IReadOnlyList<Type> OwnerTypes { get; }
Property Value
Methods
FieldsDeclaredOn(Type)
The string fields ownerType itself declares (inherited fields belong to
the base type that declares them), with the paths they have on an instance of it.
Declaration
public static IReadOnlyList<FoundationStringField> FieldsDeclaredOn(Type ownerType)
Parameters
| Type |
Name |
Description |
| Type |
ownerType |
|
Returns
MisplacedDeclarationsOn(Type)
Declaration
public static IReadOnlyList<string> MisplacedDeclarationsOn(Type ownerType)
Parameters
| Type |
Name |
Description |
| Type |
ownerType |
|
Returns
ReadFields(IEnumerable<Type>, Func<Type, IReadOnlyList<FoundationStringField>>, ICollection<string>)
Reads the fields of every type in ownerTypes through
readFieldsOf, in the stable order AllFields has. A type that
cannot be read is not allowed to take the others down with it: it contributes no rows and is named,
with the reason, in failures.
Declaration
public static IReadOnlyList<FoundationStringField> ReadFields(IEnumerable<Type> ownerTypes, Func<Type, IReadOnlyList<FoundationStringField>> readFieldsOf, ICollection<string> failures)
Parameters
Returns