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

Add ActionBuilder trait #28

Merged
merged 21 commits into from
Aug 10, 2022
Merged

Add ActionBuilder trait #28

merged 21 commits into from
Aug 10, 2022

Conversation

hikikones
Copy link
Owner

Make building a list of actions more explicit with the ActionBuilder trait. Start building a list by calling the ModifyActions::builder method, and submit with ActionBuilder::submit which returns the type for modifying actions again.

commands.actions(entity)
    // Modify actions as normal
    .add(action)
    // Make a list of actions
    .builder()
    .config(AddConfig {
        order: AddOrder::Front,
        start: false,
        repeat: false,
    })
    .push(action)
    .push(action)
    .push(action)
    .reverse()
    .submit()
    // Modify actions as normal again
    .add(action)
    .next()
    .clear()
    // ...

@hikikones hikikones merged commit 7b39d7e into main Aug 10, 2022
@hikikones hikikones deleted the builder branch August 10, 2022 22:30
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