Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- Please make sure that your PR is aligned with the guidelines in CONTRIBUTING.md to the best of your ability. --> <!-- Good PRs have tests! Make sure you have sufficient test coverage. --> ## Description <!-- Describe the changes you've made. You may include any justification you want here. --> An implementation of basic weather systems. The weather component attached to a world instance would be handled for all clients, except those that have their own weather component; these clients would be handled separately. ## Test Plan <!-- Explain how you tested your changes, and include any code that you used to test this. --> <!-- If there is an example that is sufficient to use in place of a playground, replace the playground section with a note that indicates this. --> <details> <summary>Playground</summary> ```rust fn handle_command_events( instances: Query<Entity, With<Instance>>, mut exec_cmds: EventReader<CommandExecution>, mut commands: Commands, ) { for cmd in exec_cmds.iter() { let msg = cmd.command.to_string(); let ent = instances.single(); match msg.as_str() { "ar" => { commands.entity(ent).insert(Rain(WEATHER_LEVEL.end)); } "rr" => { commands.entity(ent).remove::<Rain>(); } "at" => { commands.entity(ent).insert(Thunder(WEATHER_LEVEL.end)); } "rt" => { commands.entity(ent).remove::<Thunder>(); } _ => (), }; } } ``` </details> <!-- You need to include steps regardless of whether or not you are using a playground. --> Steps: 1. Run `cargo test --package valence --lib -- weather::test` #### Related Part of #210 Past approach #106 <!-- Link to any issues that have context for this or that this PR fixes. -->
- Loading branch information