2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-12-14 00:40:26 +00:00

Embedding types

This commit is contained in:
2025-11-03 05:59:04 +03:00
parent 9eb57e98a2
commit a764b452e2
5 changed files with 254 additions and 141 deletions

View File

@@ -189,8 +189,19 @@ namespace Esiur.Data
return new TRU(Identifier, true, UUID, SubTypes);
}
public bool IsTyped()
{
if (Identifier == TRUIdentifier.TypedList && SubTypes[0].Identifier == TRUIdentifier.UInt8)
return false;
return (UUID != null) || (SubTypes != null && SubTypes.Length > 0);
}
public bool Match(TRU other)
{
//if (UUID == null && (SubTypes == null || SubTypes.Length == 0))
// return false;
if (other.Identifier != Identifier)
return false;
if (other.UUID != UUID)
@@ -221,6 +232,8 @@ namespace Esiur.Data
case TRUIdentifier.TypedMap:
return (TDUIdentifier.TypedMap,
SubTypes[0].Compose().Concat(SubTypes[1].Compose()).ToArray());
case TRUIdentifier.Enum:
return (TDUIdentifier.TypedEnum, UUID?.Data);
default:
throw new NotImplementedException();