impls add player admin action

This commit is contained in:
2019-07-03 14:11:26 +02:00
parent 5a792edb20
commit c95c13bf18
6 changed files with 72 additions and 15 deletions

View File

@@ -72,6 +72,19 @@ pub struct NewPlayer<'a> {
pp: i32,
}
impl<'a> NewPlayer<'a> {
pub fn create(name: &'a str, wealth: f32) -> Self {
let wealth = WealthUpdate::from_gp(wealth);
Self {
name,
cp: wealth.cp,
sp: wealth.sp,
gp: wealth.gp,
pp: wealth.pp,
}
}
}
#[cfg(test)]
mod tests {
use super::*;