Skip to content

Commit

Permalink
remove shrinkwraprs
Browse files Browse the repository at this point in the history
  • Loading branch information
ezpuzz committed Jan 16, 2021
1 parent a7c8d03 commit 1fae2d9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
1 change: 0 additions & 1 deletion amethyst_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ legion = { version = "0.3.1", default-features = false, features = [
nalgebra = { version = "0.23.1", features = ["serde-serialize"] }
rayon = "1.5"
shrev = "1.1.1"
shrinkwraprs = "0.3"
simba = "0.3"
smallvec = "1.4"
thread_profiler = { version = "0.3", optional = true }
Expand Down
4 changes: 1 addition & 3 deletions amethyst_core/src/named.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{borrow::Cow, fmt::Display};

use serde::{Deserialize, Serialize};
use shrinkwraprs::Shrinkwrap;

/// A component that gives a name to an [`Entity`].
///
Expand Down Expand Up @@ -60,8 +59,7 @@ use shrinkwraprs::Shrinkwrap;
/// }
/// });
/// ```
#[derive(Shrinkwrap, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[shrinkwrap(mutable)]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Named(
/// The name of the entity this component is attached to.
pub Cow<'static, str>,
Expand Down
4 changes: 1 addition & 3 deletions amethyst_core/src/transform/components/children.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use shrinkwraprs::Shrinkwrap;
use smallvec::SmallVec;

use crate::ecs::*;

#[derive(Shrinkwrap, Debug, Default, Clone)]
#[shrinkwrap(mutable)]
#[derive(Debug, Default, Clone)]
/// Contains childrens of this entity.
/// This component is automatically generated by [parent_update_system] based on [Parent] components.
pub struct Children(pub SmallVec<[Entity; 8]>);
Expand Down
8 changes: 2 additions & 6 deletions amethyst_core/src/transform/components/parent.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
use shrinkwraprs::Shrinkwrap;

use crate::ecs::*;

#[derive(Shrinkwrap, Debug, Copy, Clone, Eq, PartialEq)]
#[shrinkwrap(mutable)]
#[derive( Debug, Copy, Clone, Eq, PartialEq)]
/// Component used for hierarchy definition.
/// Parent entity will automatically get [Children] component.
pub struct Parent(pub Entity);

#[derive(Shrinkwrap, Debug, Copy, Clone, Eq, PartialEq)]
#[shrinkwrap(mutable)]
#[derive( Debug, Copy, Clone, Eq, PartialEq)]
/// Temporary component used for observing hierarchy changes.
pub struct PreviousParent(pub Option<Entity>);
2 changes: 1 addition & 1 deletion amethyst_core/src/transform/transform_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl System<'_> for TransformSystem {

if parent_has_transform {
let parent_matrix = right
.entry_ref(**parent)
.entry_ref(parent.0)
.expect("Invalid entity in Parent component")
.into_component::<Transform>()
.unwrap()
Expand Down

0 comments on commit 1fae2d9

Please sign in to comment.