Skip to content

Add temperature emitter and query APIs - #283

Merged
ifBars merged 2 commits into
stablefrom
diffuin/237-983faff4
Aug 16, 2026
Merged

Add temperature emitter and query APIs#283
ifBars merged 2 commits into
stablefrom
diffuin/237-983faff4

Conversation

@diffuin

@diffuin diffuin Bot commented Aug 16, 2026

Copy link
Copy Markdown

Requested by @ifBars in #237.

Summary

Adds a public cross-runtime S1API.Temperature API for:

  • creating or retrieving native temperature emitters on mod-owned game objects;
  • reading and configuring emitter temperature, linear range, and world position;
  • subscribing to emitter changes through managed Action handlers;
  • taking immutable managed snapshots and querying the native temperature algorithm;
  • reading the native system-enabled state and using the game's Celsius/Fahrenheit helpers.

Grid registration, persistence, networking, custom heatmaps, and gameplay effects remain out of scope.

Implementation notes

  • Keeps native ScheduleOne and Il2CppScheduleOne types behind the public wrapper boundary.
  • Exposes ranges in world units and performs the native squared-range conversion internally.
  • Clamps finite emitter values to the native bounds and rejects non-finite scalar/vector inputs.
  • Shares event-registration state per native emitter so a handler can be removed through any wrapper for that emitter, including IL2CPP delegate conversion.
  • Provides TemperatureEmitter.ToInfo() as the safe snapshot path.

Validation

  • dotnet build S1API.Tests/S1API.Tests.csproj -c MonoMelon: passed with 0 warnings and 0 errors.
  • Complete Mono suite: 640 passed, 0 failed, 0 skipped.
  • dotnet build S1API.Tests/S1API.Tests.csproj -c Il2CppMelon: passed with 0 warnings and 0 errors.
  • Complete IL2CPP suite: 626 passed, 0 failed, 0 skipped.
  • Live Mono smoke (Schedule I_alternate): passed emitter creation, clamping, position/setter flow, event delivery, cross-wrapper removal, snapshot/query behavior, formatting, normalization, system-enabled access, and invalid-input rejection.
  • Live IL2CPP smoke (Schedule I_public): passed the same contract, including converted-delegate cross-wrapper removal.
  • Disposable probes and deployed test assemblies were removed, and both game installations were restored to their original mod sets and logs.

Compatibility

  • Source: additive relative to stable. This PR's unpublished snapshot constructor was corrected from squared range to linear range before merge.
  • Binary: additive relative to stable; no existing stable public member was removed or changed.
  • Behavior: existing stable behavior is unchanged. New setters and snapshots follow the native 0-40 °C and 0.1-100 world-unit bounds.
  • Persistence/networking: no save format, persistent identifier, RPC, or network payload changes.
  • Runtime: the same managed surface and observed behavior were verified on Mono and IL2CPP.

Closes #237

@ifBars ifBars self-assigned this Aug 16, 2026
@ifBars ifBars added this to the v3.2.0 milestone Aug 16, 2026
@ifBars ifBars added the enhancement New feature or request label Aug 16, 2026
@ifBars
ifBars merged commit 6618a60 into stable Aug 16, 2026
6 checks passed
@ifBars
ifBars deleted the diffuin/237-983faff4 branch August 16, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add temperature emitter and query APIs

1 participant