run pokemmo test

This commit is contained in:
yanweitong 2023-12-12 22:41:13 +08:00
parent 87ca8c6ec8
commit 5f846b18c0
2 changed files with 33 additions and 31 deletions

View File

@ -16,6 +16,8 @@ mod tests {
let key_words = vec![
"".to_string(),
"".to_string(),
"".to_string(),
"".to_string(),
];
single_meet_shiny(&key_words);

View File

@ -113,35 +113,35 @@ pub(crate) mod pokemon {
Quirky,
}
impl Nature {
pub fn influence(&self) -> (f32, f32, f32, f32, f32) {
return match self {
Hardy => (0_f32, 0_f32, 0_f32, 0_f32, 0_f32),
Lonely => (1.1_f32, 0.9_f32, 0_f32, 0_f32, 0_f32),
Brave => (1.1_f32, 0_f32, 0_f32, 0_f32, 0.9_f32),
Adamant => (1.1_f32, 0_f32, 0.9_f32, 0_f32, 0_f32),
Naughty => (1.1_f32, 0_f32, 0_f32, 0.9_f32, 0_f32),
Bold => (0.9_f32, 1.1_f32, 0_f32, 0_f32, 0_f32),
Docile => (0_f32, 0_f32, 0_f32, 0_f32, 0_f32),
Relaxed => (0_f32, 1.1_f32, 0_f32, 0_f32, 0.9_f32),
Impish => (0_f32, 1.1_f32, 0.9_f32, 0_f32, 0_f32),
Lax => (0_f32, 1.1_f32, 0_f32, 0.9_f32, 0_f32),
Timid => (0.9_f32, 0_f32, 0_f32, 0_f32, 1.1_f32),
Hasty => (0_f32, 0.9_f32, 0_f32, 0_f32, 1.1_f32),
Serious => (0_f32, 0_f32, 0_f32, 0_f32, 0_f32),
Jolly => (0_f32, 0_f32, 0.9_f32, 0_f32, 1.1_f32),
Naive => (0_f32, 0_f32, 0_f32, 0.9_f32, 1.1_f32),
Modest => (0.9_f32, 0_f32, 1.1_f32, 0_f32, 0_f32),
Mild => (0_f32, 0.9_f32, 1.1_f32, 0_f32, 0_f32),
Quiet => (0_f32, 0_f32, 1.1_f32, 0_f32, 0.9_f32),
Bashful => (0_f32, 0_f32, 0_f32, 0_f32, 0_f32),
Rash => (0_f32, 0_f32, 1.1_f32, 0.9_f32, 0_f32),
Calm => (0.9_f32, 0_f32, 0_f32, 1.1_f32, 0_f32),
Gentle => (0_f32, 0.9_f32, 0_f32, 1.1_f32, 0_f32),
Sassy => (0_f32, 0_f32, 0_f32, 1.1_f32, 0.9_f32),
Careful => (0_f32, 0_f32, 0.9_f32, 1.1_f32, 0_f32),
Quirky => (0_f32, 0_f32, 0_f32, 0_f32, 0_f32),
};
}
}
// impl Nature {
// pub fn influence(&self) -> (f32, f32, f32, f32, f32) {
// return match &self {
// Hardy => (0_f32, 0_f32, 0_f32, 0_f32, 0_f32),
// Lonely => (1.1_f32, 0.9_f32, 0_f32, 0_f32, 0_f32),
// Brave => (1.1_f32, 0_f32, 0_f32, 0_f32, 0.9_f32),
// Adamant => (1.1_f32, 0_f32, 0.9_f32, 0_f32, 0_f32),
// Naughty => (1.1_f32, 0_f32, 0_f32, 0.9_f32, 0_f32),
// Bold => (0.9_f32, 1.1_f32, 0_f32, 0_f32, 0_f32),
// Docile => (0_f32, 0_f32, 0_f32, 0_f32, 0_f32),
// Relaxed => (0_f32, 1.1_f32, 0_f32, 0_f32, 0.9_f32),
// Impish => (0_f32, 1.1_f32, 0.9_f32, 0_f32, 0_f32),
// Lax => (0_f32, 1.1_f32, 0_f32, 0.9_f32, 0_f32),
// Timid => (0.9_f32, 0_f32, 0_f32, 0_f32, 1.1_f32),
// Hasty => (0_f32, 0.9_f32, 0_f32, 0_f32, 1.1_f32),
// Serious => (0_f32, 0_f32, 0_f32, 0_f32, 0_f32),
// Jolly => (0_f32, 0_f32, 0.9_f32, 0_f32, 1.1_f32),
// Naive => (0_f32, 0_f32, 0_f32, 0.9_f32, 1.1_f32),
// Modest => (0.9_f32, 0_f32, 1.1_f32, 0_f32, 0_f32),
// Mild => (0_f32, 0.9_f32, 1.1_f32, 0_f32, 0_f32),
// Quiet => (0_f32, 0_f32, 1.1_f32, 0_f32, 0.9_f32),
// Bashful => (0_f32, 0_f32, 0_f32, 0_f32, 0_f32),
// Rash => (0_f32, 0_f32, 1.1_f32, 0.9_f32, 0_f32),
// Calm => (0.9_f32, 0_f32, 0_f32, 1.1_f32, 0_f32),
// Gentle => (0_f32, 0.9_f32, 0_f32, 1.1_f32, 0_f32),
// Sassy => (0_f32, 0_f32, 0_f32, 1.1_f32, 0.9_f32),
// Careful => (0_f32, 0_f32, 0.9_f32, 1.1_f32, 0_f32),
// Quirky => (0_f32, 0_f32, 0_f32, 0_f32, 0_f32),
// };
// }
// }
}