Finished documenting all public interfaces.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-07-01 17:52:00 +02:00
parent 3c8d633be7
commit 717fcdefda
7 changed files with 66 additions and 7 deletions

View File

@@ -1,14 +1,19 @@
use crate::static_data::EffectParameter;
use crate::StringKey;
/// An ability is a passive effect in battle that is attached to a Pokemon.
#[derive(Debug)]
pub struct Ability {
/// The name of the ability.
name: StringKey,
/// The name of the script effect of the ability.
effect: StringKey,
/// The parameters for the script effect of the ability.
parameters: Vec<EffectParameter>,
}
impl Ability {
/// Instantiates a new ability.
pub fn new(name: &StringKey, effect: &StringKey, parameters: Vec<EffectParameter>) -> Self {
Self {
name: name.clone(),
@@ -17,12 +22,15 @@ impl Ability {
}
}
/// The name of the ability.
pub fn name(&self) -> &StringKey {
&self.name
}
/// The name of the script effect of the ability.
pub fn effect(&self) -> &StringKey {
&self.effect
}
/// The parameters for the script effect of the ability.
pub fn parameters(&self) -> &Vec<EffectParameter> {
&self.parameters
}