[][src]Struct rust_action_heroes::component::named::Named

pub(crate) struct Named(Name);

Gives a playable character a name.

This is used to make some important decisions like "when moving left, which entity moves".

If I did it again I would make each playable character a separate component. This was implemented pretty early on in my education on ECS so I wasn't sure what an appropriate pattern was.

Not to say that this is bad -- just would probably be easier to work with if we didn't have this weird Name entity that really contains three sub-entities. For example, no two entities have the same name, so it might be better if each name was just a flag component.

Implementations

impl Named[src]

pub(crate) fn new(name: Name) -> Self[src]

pub(crate) fn get(&self) -> Name[src]

Trait Implementations

impl Component for Named[src]

type Storage = DenseVecStorage<Self>

Associated storage type for this component.

impl Debug for Named[src]

impl Display for Named[src]

impl Eq for Named[src]

impl Hash for Named[src]

impl PartialEq<Named> for Named[src]

impl StructuralEq for Named[src]

impl StructuralPartialEq for Named[src]

Auto Trait Implementations

impl RefUnwindSafe for Named

impl Send for Named

impl Sync for Named

impl Unpin for Named

impl UnwindSafe for Named

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> AnyEq for T where
    T: PartialEq<T> + Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SetParameter for T

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> Supports<T> for T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,