Skip to content

Standardize clone depth of drawable configurations - #993

Open
Cyclone1337 wants to merge 19 commits into
masterfrom
improvement/987-standardize-drawable-clone-depth
Open

Standardize clone depth of drawable configurations#993
Cyclone1337 wants to merge 19 commits into
masterfrom
improvement/987-standardize-drawable-clone-depth

Conversation

@Cyclone1337

Copy link
Copy Markdown
Collaborator

Closes #987

Summary

This PR reviews and standardizes the clone depth of drawable configurations.

The contained configurations of DrawableConfig are now cloned independently instead of being retained by reference. Mutable nested state in the individual drawable configurations is cloned where appropriate, while intentional sharing is preserved and documented.

Changes

  • Deep clone the configurations contained in DrawableConfig.
  • Deep clone nested configurations and collections in MindMapNodeConf, including BranchLineConf.
  • Preserve the intentional sharing of GameObject references contained in MindMapNodeConf.Children.
  • Preserve null ImageConf.FileData values while independently copying existing file data.
  • Validate required image data before creating AddImageNetAction.
  • Add CloneWithoutDrawableTypes() to avoid unnecessary deep cloning in surface network actions.
  • Document the clone depth of all relevant drawable configuration types.
  • Add regression tests for mutable collections, nested configurations, null values, and clone independence.

Testing

  • Added and executed regression tests for all relevant drawable configuration clone methods.
  • Executed the complete EditMode test suite successfully.
  • Verified the clone behavior at runtime in SEE, including line caps, image file data, mind map branch configurations, DrawableConfig.Clone(), and CloneWithoutDrawableTypes().

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Image validation accepts empty data that cannot produce a valid non-web image.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Standardizes drawable configuration cloning so mutable nested state is independent while intentional GameObject sharing remains intact.

Changes:

  • Deep-clones drawable configurations, collections, and mutable nested data.
  • Adds lightweight surface-only cloning and image-data validation.
  • Adds regression tests and clone-semantics documentation.
File summaries
File Description
Assets/SEETests/Net/Actions/Drawable/AddImageNetActionTests.cs.meta Registers the test asset.
Assets/SEETests/Net/Actions/Drawable/AddImageNetActionTests.cs Tests image validation.
Assets/SEETests/Net/Actions/Drawable.meta Registers the test folder.
Assets/SEETests/Net/Actions.meta Registers the test folder.
Assets/SEETests/Net.meta Registers the test folder.
Assets/SEETests/Game/Drawable/Configurations/TextConfCloneTests.cs.meta Registers the test asset.
Assets/SEETests/Game/Drawable/Configurations/TextConfCloneTests.cs Tests text cloning.
Assets/SEETests/Game/Drawable/Configurations/MindMapNodeConfCloneTests.cs.meta Registers the test asset.
Assets/SEETests/Game/Drawable/Configurations/MindMapNodeConfCloneTests.cs Tests nested and collection cloning.
Assets/SEETests/Game/Drawable/Configurations/LineConfCloneTests.cs.meta Registers the test asset.
Assets/SEETests/Game/Drawable/Configurations/LineConfCloneTests.cs Tests line cloning.
Assets/SEETests/Game/Drawable/Configurations/LineCapConfCloneTests.cs.meta Registers the test asset.
Assets/SEETests/Game/Drawable/Configurations/LineCapConfCloneTests.cs Tests line-cap cloning.
Assets/SEETests/Game/Drawable/Configurations/ImageConfCloneTests.cs.meta Registers the test asset.
Assets/SEETests/Game/Drawable/Configurations/ImageConfCloneTests.cs Tests file-data cloning.
Assets/SEETests/Game/Drawable/Configurations/DrawableConfigCloneTests.cs.meta Registers the test asset.
Assets/SEETests/Game/Drawable/Configurations/DrawableConfigCloneTests.cs Tests aggregate and surface-only clones.
Assets/SEETests/Game/Drawable/Configurations.meta Registers the test folder.
Assets/SEETests/Game/Drawable.meta Registers the test folder.
Assets/SEETests/Game.meta Registers the test folder.
Assets/SEE/Net/Actions/Drawable/SurfaceNetAction.cs Uses surface-only cloning.
Assets/SEE/Net/Actions/Drawable/AddImageNetAction.cs Validates image data before cloning.
Assets/SEE/Game/Drawable/Configurations/TextConf.cs Documents clone depth.
Assets/SEE/Game/Drawable/Configurations/MindMapNodeConf.cs Deep-clones nested configurations and collections.
Assets/SEE/Game/Drawable/Configurations/LineConf.cs Documents line clone semantics.
Assets/SEE/Game/Drawable/Configurations/LineCapConf.cs Documents line-cap clone semantics.
Assets/SEE/Game/Drawable/Configurations/ImageConf.cs Preserves null or copies file data.
Assets/SEE/Game/Drawable/Configurations/DrawableConfig.cs Deep-clones contained configurations.
Review details

Files not reviewed (13)

  • Assets/SEETests/Game.meta: Generated file
  • Assets/SEETests/Game/Drawable.meta: Generated file
  • Assets/SEETests/Game/Drawable/Configurations.meta: Generated file
  • Assets/SEETests/Game/Drawable/Configurations/DrawableConfigCloneTests.cs.meta: Generated file
  • Assets/SEETests/Game/Drawable/Configurations/ImageConfCloneTests.cs.meta: Generated file
  • Assets/SEETests/Game/Drawable/Configurations/LineCapConfCloneTests.cs.meta: Generated file
  • Assets/SEETests/Game/Drawable/Configurations/LineConfCloneTests.cs.meta: Generated file
  • Assets/SEETests/Game/Drawable/Configurations/MindMapNodeConfCloneTests.cs.meta: Generated file
  • Assets/SEETests/Game/Drawable/Configurations/TextConfCloneTests.cs.meta: Generated file
  • Assets/SEETests/Net.meta: Generated file
  • Assets/SEETests/Net/Actions.meta: Generated file
  • Assets/SEETests/Net/Actions/Drawable.meta: Generated file
  • Assets/SEETests/Net/Actions/Drawable/AddImageNetActionTests.cs.meta: Generated file
  • Files reviewed: 15/28 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Assets/SEE/Net/Actions/Drawable/AddImageNetAction.cs Outdated
@Cyclone1337
Cyclone1337 requested a review from koschke September 2, 2026 13:27

@koschke koschke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were only very minor things, which I fixed myself.
I renamed the new test classes so that they start with the prefix Test for consistency with our other test classes.

I will ask Claude for a second opinion tomorrow.

Comment thread Assets/SEETests/Game/Drawable/Configurations/DrawableConfigCloneTests.cs Outdated
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.

Review and standardize clone depth of drawable configurations

3 participants