Some more functionality for battling, check if choice is valid, implement target resolvers.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-06-14 19:11:24 +02:00
parent 8746f03500
commit a33369afcc
8 changed files with 305 additions and 10 deletions

View File

@@ -1,2 +1,40 @@
use crate::static_data::MoveData;
#[derive(Debug)]
pub struct LearnedMove {}
pub struct LearnedMove<'a> {
move_data: &'a MoveData,
max_pp: u8,
remaining_pp: u8,
learn_method: MoveLearnMethod,
}
#[derive(Copy, Clone, Debug)]
pub enum MoveLearnMethod {
Unknown = 0,
Level = 1,
}
impl<'a> LearnedMove<'a> {
pub fn new(move_data: &'a MoveData, learn_method: MoveLearnMethod) -> Self {
Self {
move_data,
max_pp: move_data.base_usages(),
remaining_pp: move_data.base_usages(),
learn_method,
}
}
pub fn move_data(&self) -> &MoveData {
self.move_data
}
pub fn max_pp(&self) -> u8 {
self.max_pp
}
pub fn remaining_pp(&self) -> u8 {
self.remaining_pp
}
pub fn learn_method(&self) -> MoveLearnMethod {
self.learn_method
}
}