Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Refactor Actions to ECS System and Component #2061

Merged
merged 12 commits into from
Oct 17, 2021

Conversation

eonarheim
Copy link
Member

@eonarheim eonarheim commented Oct 16, 2021

===:clipboard: PR Checklist :clipboard:===

  • 📌 issue exists in github for these changes
  • 🔬 existing tests still pass
  • 🙈 code conforms to the style guide
  • 📐 new tests written and passing / old tests updated with new scenario(s)
  • 📄 changelog entry added (or not needed)

==================

This is a backwards compatible change that refactors Actions into an ECS style System and Component, this removes actions out of the Actor core update loop.

This means it is now possible to share the Actions feature with all entities by adding the ActionsComponent!

See related discussion #2059

Related Actions goals on the roadmap for v0.26.0 #1161

Changes:

  • asPromise() marked deprecated but not removed
  • Action plumbing refactored to use the Actor base-type Entity and Components
  • New ActionsComponent that wraps the existing ActionContext
  • New ActionsSystem that updates all Entities with an ActionComponent
  • Small tweak to wallabyjs to pin to the current karma chromium test version (new chrome version breaks unrelated tests locally in wallaby)

@github-actions github-actions bot added the enhancement Label applied to enhancements or improvements to existing features label Oct 16, 2021
Copy link
Member

@kamranayub kamranayub left a comment

Choose a reason for hiding this comment

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

woo 🚢

@@ -282,8 +282,8 @@ export class ActionsComponent extends Component<'ex.actions'> implements ActionC
* @param entity The entity to follow
* @param followDistance The distance to maintain when following, if not specified the actor will follow at the current distance.
*/
public follow(actor: Actor, followDistance?: number): ActionContext {
return this._ctx.follow(actor, followDistance);
public follow(entity: Actor, followDistance?: number): ActionContext {
Copy link
Member Author

Choose a reason for hiding this comment

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

Ope! Totes missed these thanks!

@kamranayub kamranayub merged commit 2823055 into main Oct 17, 2021
@kamranayub kamranayub deleted the feature/refactor-actions branch October 17, 2021 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Label applied to enhancements or improvements to existing features hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants