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: Add multiFactory to SpawnComponent #3440

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

pcornelissen
Copy link
Contributor

add multiFactory to SpawnComponent to be able to create a list of components for each spawn tick. For backwards compatibility the single component factory is still supported and wrapped internally.

Description

This PR enhances the SpawnComponent to accept a multiFactory which adds a list of components per tick instead of just one.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

@spydon spydon changed the title feat: add multiFactory to SpawnComponent feat: Add multiFactory to SpawnComponent Jan 9, 2025
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Overall it looks good, just some minor comments

packages/flame/lib/src/components/spawn_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/spawn_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/spawn_component.dart Outdated Show resolved Hide resolved
packages/flame/lib/src/components/spawn_component.dart Outdated Show resolved Hide resolved
packages/flame/test/components/spawn_component_test.dart Outdated Show resolved Hide resolved
packages/flame/test/components/spawn_component_test.dart Outdated Show resolved Hide resolved
packages/flame/test/components/spawn_component_test.dart Outdated Show resolved Hide resolved
@pcornelissen pcornelissen force-pushed the multi-spawncomponent branch 3 times, most recently from 26244ea to 36be5da Compare January 9, 2025 17:54
…ponents for each spawn tick. For backwards compatibility the single component factory is still supported and wrapped internally.
@pcornelissen
Copy link
Contributor Author

The benchmark seems to be broken by itself ;)
(At least not by my commit)

@luanpotter
Copy link
Member

I did not close this!

@luanpotter luanpotter reopened this Jan 9, 2025
@luanpotter
Copy link
Member

(I will rebase it though to see if my fix worked)

Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

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

Lgtm! Thanks for your contribution.

packages/flame/lib/src/components/spawn_component.dart Outdated Show resolved Hide resolved
@spydon spydon enabled auto-merge (squash) January 9, 2025 23:27
@spydon spydon merged commit 1c898ef into flame-engine:main Jan 9, 2025
8 of 9 checks passed
@pcornelissen
Copy link
Contributor Author

You are welcome. Happy to help!

@pcornelissen pcornelissen deleted the multi-spawncomponent branch January 10, 2025 07:48
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.

3 participants