Refactor GOAP planner instantiation to use GOAPPlannerBuilder directly with automatic type inference, deprecating the goap function and adding comprehensive tests. #1321
+68
−20
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.
Motivation and Context
Refactor the GOAP planner DSL to promote a more consistent builder pattern and simplify API usage. Previously, users relied on the goap extension function, often needing to explicitly pass typeOf(). This change enables direct usage of GOAPPlannerBuilder { ... }, which leverages reified type parameters to automatically infer the state type. The goap function has been deprecated with a ReplaceWith quick fix to facilitate migration. Additionally, KDoc documentation has been updated with complete examples, and new tests verify the type inference and direct builder usage.
Breaking Changes
No. The goap function is marked as @deprecated(level = DeprecationLevel.WARNING), so existing code will continue to compile and run, but users will see a warning suggesting the new usage.
Type of the changes
Checklist
developas the base branchAdditional steps for pull requests adding a new feature