Skip to content

Commit

Permalink
Update rand to 0.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Lauzier committed Jul 22, 2021
1 parent e4164be commit 3a6e90a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion thetawave_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 14,5 @@ features = ["vulkan", "audio", "gltf"]
[dependencies]
amethyst_test = "0.15.3"
serde = "1"
rand = "0.6.5"
rand = "0.8.4"
float-cmp = "0.8.0"
24 changes: 12 additions & 12 deletions thetawave_lib/src/spawnable/spawnable_resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 54,15 @@ impl ConsumablesResource {
if is_drop {
if let Some(linear_motion) = consumable_data.random_initial_motion.linear {
motion2d_component.velocity.x =
thread_rng().gen_range(linear_motion.x.0, linear_motion.x.1);
thread_rng().gen_range(linear_motion.x.0..=linear_motion.x.1);
motion2d_component.velocity.y =
thread_rng().gen_range(linear_motion.y.0, linear_motion.y.1);
thread_rng().gen_range(linear_motion.y.0..=linear_motion.y.1);
}
}

if let Some(angular_motion) = consumable_data.random_initial_motion.angular {
motion2d_component.angular_velocity =
thread_rng().gen_range(angular_motion.0, angular_motion.1);
thread_rng().gen_range(angular_motion.0..=angular_motion.1);
}

lazy_update
Expand Down Expand Up @@ -118,14 118,14 @@ impl ItemsResource {
if is_drop {
if let Some(linear_motion) = self.random_initial_motion.linear {
motion2d_component.velocity.x =
thread_rng().gen_range(linear_motion.x.0, linear_motion.x.1);
thread_rng().gen_range(linear_motion.x.0..=linear_motion.x.1);
motion2d_component.velocity.y =
thread_rng().gen_range(linear_motion.y.0, linear_motion.y.1);
thread_rng().gen_range(linear_motion.y.0..=linear_motion.y.1);
}
}
if let Some(angular_motion) = self.random_initial_motion.angular {
motion2d_component.angular_velocity =
thread_rng().gen_range(angular_motion.0, angular_motion.1);
thread_rng().gen_range(angular_motion.0..=angular_motion.1);
}

let item_entity = lazy_update
Expand Down Expand Up @@ -176,14 176,14 @@ impl MobsResource {
if let Some(random_initial_motion) = mob_data.random_initial_motion.clone() {
if let Some(linear_motion) = random_initial_motion.linear {
motion2d_component.velocity.x =
thread_rng().gen_range(linear_motion.x.0, linear_motion.x.1);
thread_rng().gen_range(linear_motion.x.0..=linear_motion.x.1);
motion2d_component.velocity.y =
thread_rng().gen_range(linear_motion.y.0, linear_motion.y.1);
thread_rng().gen_range(linear_motion.y.0..=linear_motion.y.1);
}

if let Some(angular_motion) = random_initial_motion.angular {
motion2d_component.angular_velocity =
thread_rng().gen_range(angular_motion.0, angular_motion.1);
thread_rng().gen_range(angular_motion.0..=angular_motion.1);
}
}

Expand Down Expand Up @@ -286,14 286,14 @@ impl EffectsResource {
if let Some(random_initial_motion) = effect_data.random_initial_motion.clone() {
if let Some(linear_motion) = random_initial_motion.linear {
motion2d_component.velocity.x =
thread_rng().gen_range(linear_motion.x.0, linear_motion.x.1);
thread_rng().gen_range(linear_motion.x.0..=linear_motion.x.1);
motion2d_component.velocity.y =
thread_rng().gen_range(linear_motion.y.0, linear_motion.y.1);
thread_rng().gen_range(linear_motion.y.0..=linear_motion.y.1);
}

if let Some(angular_motion) = random_initial_motion.angular {
motion2d_component.angular_velocity =
thread_rng().gen_range(angular_motion.0, angular_motion.1);
thread_rng().gen_range(angular_motion.0..=angular_motion.1);
}
}
lazy_update.insert(effect_entity, motion2d_component);
Expand Down

0 comments on commit 3a6e90a

Please sign in to comment.