[−][src]Trait weasel::character::CharacterRules
Rules to define the structure and the behavior of characters.
Associated Types
type CreatureId: Hash + Eq + Clone + Debug + Serialize + for<'a> Deserialize<'a>
See CreatureId.
type Statistic: Id + 'static
See Statistic.
type StatisticsSeed: Clone + Debug + Serialize + for<'a> Deserialize<'a>
See StatisticsSeed.
type StatisticsAlteration: Clone + Debug + Serialize + for<'a> Deserialize<'a>
See StatisticsAlteration.
Provided methods
fn generate_statistics(
&self,
_seed: &Option<Self::StatisticsSeed>,
_entropy: &mut Entropy<R>,
_metrics: &mut WriteMetrics<R>
) -> Box<dyn Iterator<Item = Self::Statistic>>
&self,
_seed: &Option<Self::StatisticsSeed>,
_entropy: &mut Entropy<R>,
_metrics: &mut WriteMetrics<R>
) -> Box<dyn Iterator<Item = Self::Statistic>>
Generates all statistics of a creature. Statistics should have unique ids, otherwise only the last entry will be persisted.
The provided implementation generates an empty set of statistics.
fn alter(
&self,
_character: &mut dyn Character<R>,
_alteration: &Self::StatisticsAlteration,
_entropy: &mut Entropy<R>,
_metrics: &mut WriteMetrics<R>
) -> Option<Transmutation>
&self,
_character: &mut dyn Character<R>,
_alteration: &Self::StatisticsAlteration,
_entropy: &mut Entropy<R>,
_metrics: &mut WriteMetrics<R>
) -> Option<Transmutation>
Alters one or more statistics starting from the given alteration object.
Returns an optional Transmutation
to be applied to the character as result of
this alteration.
The provided implementation does nothing.