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

Revisit game actions #273

Merged
merged 2 commits into from
Jan 3, 2024
Merged

Revisit game actions #273

merged 2 commits into from
Jan 3, 2024

Conversation

keis
Copy link
Owner

@keis keis commented Jan 2, 2024

Refactor game actions

  • Action type as enum without any containing data
  • Standard action parameters (source, targets) defined in struct
  • Action systems stored in resource and dispatched by world exclusive
    handler system

Fixes #45

* Move meta actions `resume_move` and `move_to` out of game actions
src/action/queue.rs Outdated Show resolved Hide resolved
let Some(system) = systems.get(action.action_type) else {
return Ok(());
};
world.run_system(system)
Copy link
Owner Author

Choose a reason for hiding this comment

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

TODO, decouple action implementations from queue by passing action as input to system

* Action type as enum without any containing data
* Standard action parameters (source, targets) defined in struct
* Action systems stored in resource and dispatched by world exclusive
  handler system

Fixes #45
@keis keis merged commit f1a095f into master Jan 3, 2024
2 checks passed
@keis keis deleted the game-actions branch January 3, 2024 22:36
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.

Revisit game actions design
1 participant