Skip to content

Add OpenApparatus.IO library: exporters + ProjectIO + POCOs#1

Merged
SilicoBen merged 1 commit into
mainfrom
feat/extract-io-lib
May 1, 2026
Merged

Add OpenApparatus.IO library: exporters + ProjectIO + POCOs#1
SilicoBen merged 1 commit into
mainfrom
feat/extract-io-lib

Conversation

@SilicoBen

Copy link
Copy Markdown
Contributor

Summary

Extracts the file-format and exporter code from OpenApparatus.Studio into a new OpenApparatus.IO library so both the desktop app and the web port can share it.

This PR is pure additions. No files are deleted from OpenApparatus.Studio. Studio gets updated to consume from this library in a separate PR (and continues to work with its own copies until then).

What moved (and what changed during the move)

  • ObjExporter, GltfExporter, JsonExporter — moved from Studio/Services/ to OpenApparatus.IO/Exporters/. Namespace updated. No behavior changes.
  • PlacementConstraints, RoomObject (with ObjectShape, ObjectType) — POCOs that lived in Studio/ViewModels/ despite having zero MVVM dependency. Moved to OpenApparatus.IO/.
  • ProjectIO — split. The data half (ProjectFile, PassageOverrideEntry, OpeningEntry, ObjectTypeEntry, ObjectInstanceEntry) plus raw Save(path, ProjectFile) / Load(path) → ProjectFile / Parse(json) → ProjectFile / Stringify(file) → json lives in IO. The VM-coupled From(vm) / Apply(vm) adapters drop — editors are responsible for converting their own state to/from ProjectFile. The Studio VM will get ToProjectFile() / RestoreFromProjectFile() methods in the consumer PR.

Target framework

net8.0 only. The IO lib isn't a Unity-runtime concern (Unity has its own OBJ/glTF importers), so no netstandard2.1 target. The web port at net10.0 consumes the net8.0 asset via forward compatibility.

Test plan

  • dotnet build -c Release clean across solution
  • dotnet test -c Release — 129 pass, 0 fail
  • No changes to existing Core or test projects
  • Reviewer to verify the namespace split feels right (OpenApparatus.IO for POCOs + ProjectIO; OpenApparatus.IO.Exporters for the three exporters)

…int POCOs

Extracts the file-format and exporter code from OpenApparatus.Studio into a
new OpenApparatus.IO library so both the desktop app and the web port can
share it. Pure-additions PR — Studio is updated to consume from here in a
separate PR.

Moved (with namespace updates only, no behavior changes):
- ObjExporter, GltfExporter, JsonExporter (Studio/Services -> IO/Exporters)
- ProjectIO, with the VM-coupled From(vm) / Apply(vm) adapters dropped:
  the IO half now takes/returns a ProjectFile data object. Editors are
  responsible for converting their own state to/from ProjectFile. Studio
  will get ToProjectFile() / RestoreFromProjectFile() methods on its VM.
- PlacementConstraints, RoomObject, ObjectType (POCOs from Studio.ViewModels)

Targets net8.0. Doesn't add netstandard2.1 since the IO lib isn't a
Unity-runtime concern.

Tests pass (129 / 0).
@SilicoBen SilicoBen merged commit cd05448 into main May 1, 2026
3 checks passed
@SilicoBen SilicoBen deleted the feat/extract-io-lib branch May 1, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant