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

docs: Add some documentation for the multiFactory in the SpawnComponent #3443

Merged

Conversation

pcornelissen
Copy link
Contributor

Description

The PR add some explanation for the new multiFactory feature in the SpawnComponent

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

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.

Other than the line length it looks good!

Comment on lines 827 to 834
The factory functions takes an `int` as an argument, which is the number of components that have
been spawned, so if for example 4 components have been spawned already the 5th call of the factory method will be called with the `amount=4`, since the counting starts at 0 for the first call.

The `factory` with a single component is for backward compatibility, so you should use the `multiFactory` if in doubt. A single component `factory` will be wrapped internally to return a single item list and then used as the `multiFactory`.

Copy link
Member

Choose a reason for hiding this comment

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

Max line-length is 100

Copy link
Contributor Author

Choose a reason for hiding this comment

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

weird, I thought I had added newlines everywhere

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be better now.

@pcornelissen pcornelissen force-pushed the spawncomponent-multifactory-docs branch from 5d9b8d4 to 66dba81 Compare January 10, 2025 10:41
@pcornelissen pcornelissen force-pushed the spawncomponent-multifactory-docs branch from 66dba81 to 6eaa176 Compare January 10, 2025 10:51
@pcornelissen pcornelissen changed the title chore: Add some documentation for the multiFactory in the SpawnComponent docs: Add some documentation for the multiFactory in the SpawnComponent Jan 10, 2025
@spydon spydon enabled auto-merge (squash) January 10, 2025 10:54
@spydon spydon merged commit 600572b into flame-engine:main Jan 10, 2025
9 of 10 checks passed
@pcornelissen pcornelissen deleted the spawncomponent-multifactory-docs branch January 10, 2025 11:06
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.

2 participants