Skip to content
Snippets Groups Projects
Commit 94e1b1f6 authored by Kat Marchán's avatar Kat Marchán
Browse files

fix(tests): update tests

parent edecc4c9
No related branches found
No related tags found
No related merge requests found
...@@ -28,12 +28,12 @@ fn setup(mut cmds: Commands) { ...@@ -28,12 +28,12 @@ fn setup(mut cmds: Commands) {
); );
} }
#[derive(Clone, Component, Debug, Default)] #[derive(Component, Debug, Default)]
struct Action1; struct Action1;
impl ActionBuilder for Action1 { impl ActionBuilder for Action1 {
fn build(&self, cmd: &mut Commands, action: Entity, _actor: Entity) { fn build(&self, cmd: &mut Commands, action: Entity, _actor: Entity) {
cmd.entity(action) cmd.entity(action)
.insert(self.clone()) .insert(Self)
.insert(ActionState::Requested); .insert(ActionState::Requested);
} }
} }
...@@ -50,12 +50,12 @@ fn action1(mut query: Query<(&Actor, &mut ActionState), With<Action1>>) { ...@@ -50,12 +50,12 @@ fn action1(mut query: Query<(&Actor, &mut ActionState), With<Action1>>) {
} }
} }
#[derive(Clone, Component, Debug, Default)] #[derive(Component, Debug, Default)]
struct Action2; struct Action2;
impl ActionBuilder for Action2 { impl ActionBuilder for Action2 {
fn build(&self, cmd: &mut Commands, action: Entity, _actor: Entity) { fn build(&self, cmd: &mut Commands, action: Entity, _actor: Entity) {
cmd.entity(action) cmd.entity(action)
.insert(self.clone()) .insert(Self)
.insert(ActionState::Requested); .insert(ActionState::Requested);
} }
} }
...@@ -72,12 +72,12 @@ fn action2(mut query: Query<(&Actor, &mut ActionState), With<Action2>>) { ...@@ -72,12 +72,12 @@ fn action2(mut query: Query<(&Actor, &mut ActionState), With<Action2>>) {
} }
} }
#[derive(Clone, Component, Debug, Default)] #[derive(Component, Debug, Default)]
struct ExitAction; struct ExitAction;
impl ActionBuilder for ExitAction { impl ActionBuilder for ExitAction {
fn build(&self, cmd: &mut Commands, action: Entity, _actor: Entity) { fn build(&self, cmd: &mut Commands, action: Entity, _actor: Entity) {
cmd.entity(action) cmd.entity(action)
.insert(self.clone()) .insert(Self)
.insert(ActionState::Requested); .insert(ActionState::Requested);
} }
} }
...@@ -101,12 +101,12 @@ fn last() { ...@@ -101,12 +101,12 @@ fn last() {
println!(); println!();
} }
#[derive(Clone, Component, Debug, Default)] #[derive(Component, Debug, Default)]
struct FailureAction; struct FailureAction;
impl ActionBuilder for FailureAction { impl ActionBuilder for FailureAction {
fn build(&self, cmd: &mut Commands, action: Entity, _actor: Entity) { fn build(&self, cmd: &mut Commands, action: Entity, _actor: Entity) {
cmd.entity(action) cmd.entity(action)
.insert(self.clone()) .insert(Self)
.insert(ActionState::Requested); .insert(ActionState::Requested);
} }
} }
...@@ -134,11 +134,6 @@ struct GlobalState { ...@@ -134,11 +134,6 @@ struct GlobalState {
#[derive(Clone, Component, Debug)] #[derive(Clone, Component, Debug)]
struct NoFailureScore; struct NoFailureScore;
impl ScorerBuilder for NoFailureScore {
fn build(&self, cmd: &mut Commands, action: Entity, _actor: Entity) {
cmd.entity(action).insert(self.clone());
}
}
fn no_failure_score( fn no_failure_score(
mut query: Query<(&NoFailureScore, &mut Score)>, mut query: Query<(&NoFailureScore, &mut Score)>,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment