Module entity

Module entity 

Source
Expand description

A tiny specific Entity Component System (ECS) for Minecraft entity ecosystem.

Structs§

DefaultEntityCodec
A useful structure that implements the method EntityCodec::default and add to the given builder the Default:default() value of the generic type T. Actually, EntityCodec is only implemented when your type T is Default + Component. This bound cannot be defined in the structure definition for now because it would not be possible to define it statically.
EntityType
A type for static definition of entity types.
GlobalEntities
The global entities palette used in level environment.
NullEntityCodec
A null codec, this codec make nothing and can be used as a temporary placeholder.

Traits§

EntityCodec
This trait describes a specific way of encoding, decoding and building a default variant of a component structure for an entity. This trait should usually be implemented for each component of an entity, however because it doesn’t provide any type restriction you can encode, decode and add whatever default value you want.
EntityComponent
A trait to implement to component structures that support a codec, this is used by entities! macro in order to reduce boilerplate.
SingleEntityCodec
This trait is a simpler specification of EntityCodec with the restriction of allowing only one component (implementing hecs::Component) to be encoded or decoded. The component type also have to implement Default to provide a default EntityCodec::default implementation.