Skip to content

Add Range attribute for property constraints and enhance game state logic#50

Merged
amasiye merged 1 commit into
mainfrom
develop
Mar 20, 2026
Merged

Add Range attribute for property constraints and enhance game state logic#50
amasiye merged 1 commit into
mainfrom
develop

Conversation

@amasiye

@amasiye amasiye commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces enhancements to engine component metadata hydration, improves pause and scene state transitions, and adds new tests to ensure correct behavior. Key changes include improved handling of pause/resume logic, more comprehensive scene metadata hydration (including native and compound types), and the addition of a Range attribute for property constraints.

Engine metadata hydration improvements:

  • Added tests to verify that engine components correctly hydrate UI element references, native engine types (like Texture, Rect, Sprite, and colors), and compound structures from scene metadata. New probe classes and test cases were introduced to cover these scenarios. [1] [2] [3]

Pause and scene state logic:

  • Updated PausedState and SceneState to only resume or suspend when the relevant state is present, preventing unintended updates or transitions. [1] [2]
  • Improved unit tests for PausedState to ensure the pause menu does not update on the frame resume is requested, and added helper methods for managing input state in tests. [1] [2]
  • Added a new test for SceneState to verify that the active scene does not advance when pause is pressed, with a dedicated test game class to manage state transitions.

Texture class enhancements:

  • Added requestedWidth and requestedHeight properties to the Texture class, along with corresponding getters, to retain and expose the original authoring constraints for textures. [1] [2] [3]

Attributes and constraints:

  • Introduced a new Range attribute to allow property constraints (min, max, step) to be specified for properties, providing a foundation for future validation or UI tooling.

Test infrastructure improvements:

  • Enhanced test game classes in both PausedStateTest and SceneStateTest to support explicit state registration, retrieval, and transitions, enabling more robust and isolated testing of stateful engine behavior. [1] [2]

@amasiye amasiye merged commit 22e636b into main Mar 20, 2026
0 of 2 checks passed
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