EntityAssigner

Trait EntityAssigner 

Source
pub trait EntityAssigner {
    // Required method
    fn new(
        name: String,
        class_names: ClassNamesToRoll,
        min: CardinalityValue,
        max: CardinalityValue,
        injectors: Injectors,
    ) -> Self;
}
Expand description

A trait for creating commands related to entity assignments. Useful for operations such as rolling single entities, handling entity arrays, or choosing from collected entities.

Required Methods§

Source

fn new( name: String, class_names: ClassNamesToRoll, min: CardinalityValue, max: CardinalityValue, injectors: Injectors, ) -> Self

Constructs a new instance implementing the EntityAssigner trait.

§Parameters
  • name: The attribute name to which the entities will be assigned.
  • class_names: Specifies the classes from which entities will be rolled or selected.
  • min: Specifies the minimum number of entities to be rolled or selected.
  • max: Specifies the maximum number of entities to be rolled or selected.
  • injectors: A set of injectors to enhance entities with additional attributes or to override existing attributes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§