[−][src]Trait weasel::team::TeamRules
Collection of rules to manage teams of creatures.
Associated Types
type Id: Hash + Eq + PartialOrd + Clone + Debug + Serialize + for<'a> Deserialize<'a>
See TeamId.
type ObjectivesSeed: Clone + Debug + Serialize + for<'a> Deserialize<'a>
See ObjectivesSeed.
type Objectives: Default
See Objectives.
Provided methods
fn allow_new_entity(
&self,
_state: &BattleState<R>,
_team: &Team<R>,
_type: EntityAddition<R>
) -> bool
&self,
_state: &BattleState<R>,
_team: &Team<R>,
_type: EntityAddition<R>
) -> bool
Checks if the addition of a new entity in the given team is allowed.
The provided implementation accepts any new entity.
fn generate_objectives(
&self,
_seed: &Option<Self::ObjectivesSeed>
) -> Self::Objectives
&self,
_seed: &Option<Self::ObjectivesSeed>
) -> Self::Objectives
Generate the objectives for a team.
The provided implementation returns Objectives::default()
.
If you set team Conclusion
manually, you may avoid implementing this method.
fn check_objectives_on_event(
&self,
_state: &BattleState<R>,
_team: &Team<R>,
_metrics: &ReadMetrics<R>
) -> Option<Conclusion>
&self,
_state: &BattleState<R>,
_team: &Team<R>,
_metrics: &ReadMetrics<R>
) -> Option<Conclusion>
Checks if the team has completed its objectives. This check is called after every event.
The provided implementation does not return any conclusion.
If you set team Conclusion
manually, you may avoid implementing this method.
Returns the Conclusion
for this team, or none if it did not reach any.
fn check_objectives_on_round(
&self,
_state: &BattleState<R>,
_team: &Team<R>,
_metrics: &ReadMetrics<R>
) -> Option<Conclusion>
&self,
_state: &BattleState<R>,
_team: &Team<R>,
_metrics: &ReadMetrics<R>
) -> Option<Conclusion>
Checks if the team has completed its objectives. This check is called every time a round ends.
The provided implementation does not return any conclusion.
If you set team Conclusion
manually, you may avoid implementing this method.
Returns the Conclusion
for this team, or none if it did not reach any.