Files
yugioh-legacy-engine/binding/YGOLegacy.Engine/YGOLegacy.Engine.csproj
T
donnyandClaude Fable 5.1 ffd50fa147
Release / windows (push) Successful in 32s
Release / android (push) Successful in 36s
Release / linux (push) Successful in 1m4s
Release / release (push) Successful in 5s
Release / attach-windows (push) Successful in 1s
binding: EngineApi, MessageScan, GameMessage, EngineBinding; contract section (e); v1.1.0 changelog (TICKET-398)
Namespace YGOLegacy.Engine in binding/YGOLegacy.Engine:
- EngineApi: one DllImport("ygol-engine", Cdecl) extern per export of contract/ocgapi.h (45),
  C names kept, types by the contract's type rule; delegates ScriptReader, CardReader,
  MessageHandler beside it.
- MessageScan: MsgInfo, Scan, Blank, BlankPileCodes, PromptName moved from the Unity bot host
  (LocalDuelHost), public, bodies unchanged (+ the private FieldOffset helper and the five
  constants they read).
- GameMessage: enum : byte, one member per #define MSG_* in core/common.h (84), PascalCase names.
- EngineBinding: const Version generated at build from the EngineVersion property into
  obj/EngineBindingVersion.cs (local by default); CheckNative() compares it with
  ygol_engine_version() and throws InvalidOperationException naming both.

Tests: EngineApiParityTests (header names vs extern names, both ways; public, Cdecl, no
CharSet.Unicode, no overloads) and GameMessageParityTests (missing, extra, renumbered).
114 -> 122 tests, green.

contract/engine-contract.md: five parts; "(e) C# binding" with the 45-row extern table, the type
rule and the version rule; engine.json's binding key documented. CHANGELOG.md: Unreleased ->
v1.1.0 with the TICKET-397 and TICKET-398 rows. README.md: the Binding section names the four
types and CheckNative().

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DJUFwdiGCHipsxLkgxssSR
2026-10-15 16:30:24 -07:00

40 lines
1.8 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<LangVersion>9</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>disable</Nullable>
<AssemblyName>YGOLegacy.Engine</AssemblyName>
<RootNamespace>YGOLegacy.Engine</RootNamespace>
<Deterministic>true</Deterministic>
<DebugType>portable</DebugType>
<EngineVersion Condition="'$(EngineVersion)' == ''">local</EngineVersion>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
<InformationalVersion>$(EngineVersion)</InformationalVersion>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>
<Target Name="GenerateEngineBindingVersion" BeforeTargets="CoreCompile">
<PropertyGroup>
<EngineBindingVersionFile>$(IntermediateOutputPath)EngineBindingVersion.cs</EngineBindingVersionFile>
</PropertyGroup>
<ItemGroup>
<EngineBindingVersionLine Include="namespace YGOLegacy.Engine" />
<EngineBindingVersionLine Include="{" />
<EngineBindingVersionLine Include=" public static partial class EngineBinding" />
<EngineBindingVersionLine Include=" {" />
<EngineBindingVersionLine Include=" public const string Version = &quot;$(EngineVersion)&quot;%3B" />
<EngineBindingVersionLine Include=" }" />
<EngineBindingVersionLine Include="}" />
</ItemGroup>
<WriteLinesToFile File="$(EngineBindingVersionFile)" Lines="@(EngineBindingVersionLine)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<ItemGroup>
<Compile Include="$(EngineBindingVersionFile)" />
<FileWrites Include="$(EngineBindingVersionFile)" />
</ItemGroup>
</Target>
</Project>