Keep Eve surface wire fields transport-safe
This commit is contained in:
parent
11aa4e14ac
commit
2aeb3c6325
1 changed files with 57 additions and 9 deletions
|
|
@ -122,7 +122,6 @@ namespace GameCult.Eve.Surface
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[SerializationConstructor]
|
|
||||||
public EveSurfaceComponent(
|
public EveSurfaceComponent(
|
||||||
string id,
|
string id,
|
||||||
string kind,
|
string kind,
|
||||||
|
|
@ -132,12 +131,36 @@ namespace GameCult.Eve.Surface
|
||||||
IReadOnlyList<EveEmbeddedDocumentSlot> embeddedDocuments,
|
IReadOnlyList<EveEmbeddedDocumentSlot> embeddedDocuments,
|
||||||
IReadOnlyDictionary<string, string>? layout = null,
|
IReadOnlyDictionary<string, string>? layout = null,
|
||||||
IReadOnlyDictionary<string, string>? style = null)
|
IReadOnlyDictionary<string, string>? style = null)
|
||||||
|
: this(
|
||||||
|
id,
|
||||||
|
kind,
|
||||||
|
props,
|
||||||
|
children,
|
||||||
|
(stateBindings ?? Array.Empty<CultMeshStateBindingDescriptor>())
|
||||||
|
.Select(CultMeshStateBindingRecord.FromBinding)
|
||||||
|
.ToArray(),
|
||||||
|
embeddedDocuments,
|
||||||
|
layout,
|
||||||
|
style)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationConstructor]
|
||||||
|
public EveSurfaceComponent(
|
||||||
|
string id,
|
||||||
|
string kind,
|
||||||
|
IReadOnlyDictionary<string, string> props,
|
||||||
|
IReadOnlyList<EveSurfaceComponent> children,
|
||||||
|
CultMeshStateBindingRecord[] stateBindingRecords,
|
||||||
|
IReadOnlyList<EveEmbeddedDocumentSlot> embeddedDocuments,
|
||||||
|
IReadOnlyDictionary<string, string>? layout = null,
|
||||||
|
IReadOnlyDictionary<string, string>? style = null)
|
||||||
{
|
{
|
||||||
Id = id ?? "";
|
Id = id ?? "";
|
||||||
Kind = kind ?? "";
|
Kind = kind ?? "";
|
||||||
Props = props ?? new Dictionary<string, string>(StringComparer.Ordinal);
|
Props = props ?? new Dictionary<string, string>(StringComparer.Ordinal);
|
||||||
Children = children ?? Array.Empty<EveSurfaceComponent>();
|
Children = children ?? Array.Empty<EveSurfaceComponent>();
|
||||||
StateBindings = stateBindings ?? Array.Empty<CultMeshStateBindingDescriptor>();
|
StateBindingRecords = stateBindingRecords ?? Array.Empty<CultMeshStateBindingRecord>();
|
||||||
EmbeddedDocuments = embeddedDocuments ?? Array.Empty<EveEmbeddedDocumentSlot>();
|
EmbeddedDocuments = embeddedDocuments ?? Array.Empty<EveEmbeddedDocumentSlot>();
|
||||||
Layout = layout ?? new Dictionary<string, string>(StringComparer.Ordinal);
|
Layout = layout ?? new Dictionary<string, string>(StringComparer.Ordinal);
|
||||||
Style = style ?? new Dictionary<string, string>(StringComparer.Ordinal);
|
Style = style ?? new Dictionary<string, string>(StringComparer.Ordinal);
|
||||||
|
|
@ -156,7 +179,11 @@ namespace GameCult.Eve.Surface
|
||||||
public IReadOnlyList<EveSurfaceComponent> Children { get; }
|
public IReadOnlyList<EveSurfaceComponent> Children { get; }
|
||||||
|
|
||||||
[Key(4)]
|
[Key(4)]
|
||||||
public IReadOnlyList<CultMeshStateBindingDescriptor> StateBindings { get; }
|
public CultMeshStateBindingRecord[] StateBindingRecords { get; }
|
||||||
|
|
||||||
|
[IgnoreMember]
|
||||||
|
public IReadOnlyList<CultMeshStateBindingDescriptor> StateBindings =>
|
||||||
|
StateBindingRecords.Select(record => record.ToBinding()).ToArray();
|
||||||
|
|
||||||
[Key(5)]
|
[Key(5)]
|
||||||
public IReadOnlyList<EveEmbeddedDocumentSlot> EmbeddedDocuments { get; }
|
public IReadOnlyList<EveEmbeddedDocumentSlot> EmbeddedDocuments { get; }
|
||||||
|
|
@ -200,19 +227,29 @@ namespace GameCult.Eve.Surface
|
||||||
[MessagePackObject]
|
[MessagePackObject]
|
||||||
public sealed class EveEmbeddedDocumentSlot
|
public sealed class EveEmbeddedDocumentSlot
|
||||||
{
|
{
|
||||||
[SerializationConstructor]
|
|
||||||
public EveEmbeddedDocumentSlot(
|
public EveEmbeddedDocumentSlot(
|
||||||
string slotId,
|
string slotId,
|
||||||
string documentId,
|
string documentId,
|
||||||
string schemaId,
|
string schemaId,
|
||||||
string presentationKind,
|
string presentationKind,
|
||||||
CultMeshRouteHint? routeHint = null)
|
CultMeshRouteHint? routeHint = null)
|
||||||
|
: this(slotId, documentId, schemaId, presentationKind, CultMeshRouteRecord.FromRoute(routeHint))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[SerializationConstructor]
|
||||||
|
public EveEmbeddedDocumentSlot(
|
||||||
|
string slotId,
|
||||||
|
string documentId,
|
||||||
|
string schemaId,
|
||||||
|
string presentationKind,
|
||||||
|
CultMeshRouteRecord route)
|
||||||
{
|
{
|
||||||
SlotId = slotId ?? "";
|
SlotId = slotId ?? "";
|
||||||
DocumentId = documentId ?? "";
|
DocumentId = documentId ?? "";
|
||||||
SchemaId = schemaId ?? "";
|
SchemaId = schemaId ?? "";
|
||||||
PresentationKind = presentationKind ?? "";
|
PresentationKind = presentationKind ?? "";
|
||||||
RouteHint = routeHint ?? CultMeshRouteHint.Automatic;
|
Route = route ?? CultMeshRouteRecord.FromRoute(CultMeshRouteHint.Automatic);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Key(0)]
|
[Key(0)]
|
||||||
|
|
@ -228,7 +265,10 @@ namespace GameCult.Eve.Surface
|
||||||
public string PresentationKind { get; }
|
public string PresentationKind { get; }
|
||||||
|
|
||||||
[Key(4)]
|
[Key(4)]
|
||||||
public CultMeshRouteHint RouteHint { get; }
|
public CultMeshRouteRecord Route { get; }
|
||||||
|
|
||||||
|
[IgnoreMember]
|
||||||
|
public CultMeshRouteHint RouteHint => Route.ToRoute();
|
||||||
}
|
}
|
||||||
|
|
||||||
[MessagePackObject]
|
[MessagePackObject]
|
||||||
|
|
@ -251,14 +291,22 @@ namespace GameCult.Eve.Surface
|
||||||
[MessagePackObject]
|
[MessagePackObject]
|
||||||
public sealed class EveCommandTemplate
|
public sealed class EveCommandTemplate
|
||||||
{
|
{
|
||||||
[SerializationConstructor]
|
|
||||||
public EveCommandTemplate(CultMeshOperationBindingDescriptor operation)
|
public EveCommandTemplate(CultMeshOperationBindingDescriptor operation)
|
||||||
|
: this(CultMeshOperationBindingRecord.FromBinding(operation))
|
||||||
{
|
{
|
||||||
Operation = operation ?? throw new ArgumentNullException(nameof(operation));
|
}
|
||||||
|
|
||||||
|
[SerializationConstructor]
|
||||||
|
public EveCommandTemplate(CultMeshOperationBindingRecord operationRecord)
|
||||||
|
{
|
||||||
|
OperationRecord = operationRecord ?? throw new ArgumentNullException(nameof(operationRecord));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Key(0)]
|
[Key(0)]
|
||||||
public CultMeshOperationBindingDescriptor Operation { get; }
|
public CultMeshOperationBindingRecord OperationRecord { get; }
|
||||||
|
|
||||||
|
[IgnoreMember]
|
||||||
|
public CultMeshOperationBindingDescriptor Operation => OperationRecord.ToBinding();
|
||||||
|
|
||||||
[IgnoreMember]
|
[IgnoreMember]
|
||||||
public string Command => Operation.OperationId;
|
public string Command => Operation.OperationId;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue