Add OpenApparatus.IO library: exporters + ProjectIO + POCOs#1
Merged
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts the file-format and exporter code from
OpenApparatus.Studiointo a newOpenApparatus.IOlibrary 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 fromStudio/Services/toOpenApparatus.IO/Exporters/. Namespace updated. No behavior changes.PlacementConstraints,RoomObject(withObjectShape,ObjectType) — POCOs that lived inStudio/ViewModels/despite having zero MVVM dependency. Moved toOpenApparatus.IO/.ProjectIO— split. The data half (ProjectFile,PassageOverrideEntry,OpeningEntry,ObjectTypeEntry,ObjectInstanceEntry) plus rawSave(path, ProjectFile)/Load(path) → ProjectFile/Parse(json) → ProjectFile/Stringify(file) → jsonlives in IO. The VM-coupledFrom(vm)/Apply(vm)adapters drop — editors are responsible for converting their own state to/fromProjectFile. The Studio VM will getToProjectFile()/RestoreFromProjectFile()methods in the consumer PR.Target framework
net8.0only. The IO lib isn't a Unity-runtime concern (Unity has its own OBJ/glTF importers), so nonetstandard2.1target. The web port atnet10.0consumes thenet8.0asset via forward compatibility.Test plan
dotnet build -c Releaseclean across solutiondotnet test -c Release— 129 pass, 0 failOpenApparatus.IOfor POCOs + ProjectIO;OpenApparatus.IO.Exportersfor the three exporters)