Macro keeshond::spawnables
source · [−]macro_rules! spawnables {
[$name:ident; $($item:ident $(: $spawnstruct:ty)?),*] => { ... };
}
Expand description
Helper macro to define an enum of different spawnable objects. Basic format:
keeshond::spawnables!
{
SpawnId;
Coin,
Dragon : path::to::Dragon,
Key : path::to::Key
}
The first item, SpawnId
, is the type name for the enum. After the semicolon is a comma-separated
list of different spawnable objects. Each object name may optionally be followed by a colon and
a path to a struct that implements SpawnableConfig. This allows defining the
Components for the spawnable in a different module.