From cf9a8652a33d2724813b8d66cad5ca2df78e7ff8 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 23:27:44 +0100 Subject: [PATCH] Define portable Eve world identity and input contracts --- .../GameCult.Eve.Contracts.csproj | 17 ++++++ .../GameCult.Eve.Contracts.csproj.meta | 7 +++ .../GameCult.Eve.Surface.csproj | 5 +- .../Runtime/EveEntitySoaViewDocument.cs | 14 +++++ .../Runtime/EveInputCapabilityDocument.cs | 59 +++++++++++++++++++ .../EveInputCapabilityDocument.cs.meta | 2 + 6 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 packages/org.gamecult.eve.surface/GameCult.Eve.Contracts.csproj create mode 100644 packages/org.gamecult.eve.surface/GameCult.Eve.Contracts.csproj.meta create mode 100644 packages/org.gamecult.eve.surface/Runtime/EveInputCapabilityDocument.cs create mode 100644 packages/org.gamecult.eve.surface/Runtime/EveInputCapabilityDocument.cs.meta diff --git a/packages/org.gamecult.eve.surface/GameCult.Eve.Contracts.csproj b/packages/org.gamecult.eve.surface/GameCult.Eve.Contracts.csproj new file mode 100644 index 0000000..6b453f0 --- /dev/null +++ b/packages/org.gamecult.eve.surface/GameCult.Eve.Contracts.csproj @@ -0,0 +1,17 @@ + + + netstandard2.1 + enable + latest + enable + GameCult.Eve.Surface + Portable Eve surface, provider, input, plugin, and entity-view contracts. + $(MSBuildThisFileDirectory)..\..\..\CultLib + + + + + + + + diff --git a/packages/org.gamecult.eve.surface/GameCult.Eve.Contracts.csproj.meta b/packages/org.gamecult.eve.surface/GameCult.Eve.Contracts.csproj.meta new file mode 100644 index 0000000..3b5cba0 --- /dev/null +++ b/packages/org.gamecult.eve.surface/GameCult.Eve.Contracts.csproj.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8a186b6d206ffa847aa276e984162512 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/packages/org.gamecult.eve.surface/GameCult.Eve.Surface.csproj b/packages/org.gamecult.eve.surface/GameCult.Eve.Surface.csproj index 16839dd..f07f7e8 100644 --- a/packages/org.gamecult.eve.surface/GameCult.Eve.Surface.csproj +++ b/packages/org.gamecult.eve.surface/GameCult.Eve.Surface.csproj @@ -5,10 +5,11 @@ latest enable Portable Eve surface and provider contracts. + $(MSBuildThisFileDirectory)..\..\..\CultLib - - + + diff --git a/packages/org.gamecult.eve.surface/Runtime/EveEntitySoaViewDocument.cs b/packages/org.gamecult.eve.surface/Runtime/EveEntitySoaViewDocument.cs index 222b4a1..efe1caf 100644 --- a/packages/org.gamecult.eve.surface/Runtime/EveEntitySoaViewDocument.cs +++ b/packages/org.gamecult.eve.surface/Runtime/EveEntitySoaViewDocument.cs @@ -24,6 +24,20 @@ namespace GameCult.Eve.Surface [Key(9)] public EveEntitySoaColumn[] Columns { get; set; } = Array.Empty(); [Key(10)] public EveEntitySoaDirtyRange[] DirtyRanges { get; set; } = Array.Empty(); [Key(11)] public EveEntityRenderGroup[] RenderGroups { get; set; } = Array.Empty(); + [Key(12)] public EveEntitySoaIdentity[] Identities { get; set; } = Array.Empty(); + } + + [MessagePackObject] + public sealed class EveEntitySoaIdentity + { + [Key(0)] public int EntityIndex { get; set; } = -1; + [Key(1)] public string EntityId { get; set; } = ""; + [Key(2)] public string Kind { get; set; } = ""; + [Key(3)] public string Label { get; set; } = ""; + [Key(4)] public string Faction { get; set; } = ""; + [Key(5)] public bool Selectable { get; set; } = true; + [Key(6)] public bool Controllable { get; set; } + [Key(7)] public string AssetRef { get; set; } = ""; } [MessagePackObject] diff --git a/packages/org.gamecult.eve.surface/Runtime/EveInputCapabilityDocument.cs b/packages/org.gamecult.eve.surface/Runtime/EveInputCapabilityDocument.cs new file mode 100644 index 0000000..356edee --- /dev/null +++ b/packages/org.gamecult.eve.surface/Runtime/EveInputCapabilityDocument.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using GameCult.Caching; +using MessagePack; + +namespace GameCult.Eve.Surface +{ + [CultDocument("gamecult.eve.input_capability", SchemaId)] + [MessagePackObject] + public sealed class EveInputCapabilityDocument + { + public const string SchemaId = "gamecult.eve.input_capability.v1"; + [Key(0)] public string Schema { get; set; } = SchemaId; + [Key(1)] public string ProviderId { get; set; } = ""; + [Key(2)] public string CapabilityId { get; set; } = ""; + [Key(3)] public long Version { get; set; } + [Key(4)] public EveInputActionDocument[] Actions { get; set; } = Array.Empty(); + [Key(5)] public EveInputProfileDocument[] DefaultProfiles { get; set; } = Array.Empty(); + } + + [MessagePackObject] + public sealed class EveInputActionDocument + { + [Key(0)] public string ActionId { get; set; } = ""; + [Key(1)] public string Label { get; set; } = ""; + [Key(2)] public string Operation { get; set; } = ""; + [Key(3)] public string Context { get; set; } = "pilot"; + [Key(4)] public string Category { get; set; } = "ship"; + [Key(5)] public string Availability { get; set; } = "available"; + [Key(6)] public string SourceRef { get; set; } = ""; + [Key(7)] public Dictionary Payload { get; set; } = new Dictionary(StringComparer.Ordinal); + } + + [MessagePackObject] + public sealed class EveInputProfileDocument + { + [Key(0)] public string ProfileId { get; set; } = ""; + [Key(1)] public string DeviceClass { get; set; } = ""; + [Key(2)] public EveInputBindingDocument[] Bindings { get; set; } = Array.Empty(); + } + + [MessagePackObject] + public sealed class EveInputBindingDocument + { + [Key(0)] public string BindingId { get; set; } = ""; + [Key(1)] public string ActionId { get; set; } = ""; + [Key(2)] public EveInputGestureDocument Gesture { get; set; } = new EveInputGestureDocument(); + [Key(3)] public bool ActionBar { get; set; } + } + + [MessagePackObject] + public sealed class EveInputGestureDocument + { + [Key(0)] public string Kind { get; set; } = "direct"; + [Key(1)] public string[] Controls { get; set; } = Array.Empty(); + [Key(2)] public int MaxStepIntervalMs { get; set; } = 650; + [Key(3)] public string CompletionControl { get; set; } = ""; + } +} diff --git a/packages/org.gamecult.eve.surface/Runtime/EveInputCapabilityDocument.cs.meta b/packages/org.gamecult.eve.surface/Runtime/EveInputCapabilityDocument.cs.meta new file mode 100644 index 0000000..9a01871 --- /dev/null +++ b/packages/org.gamecult.eve.surface/Runtime/EveInputCapabilityDocument.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4c297c7dbb64a0f49a7f805e770c5e55 \ No newline at end of file