impls add player admin action
This commit is contained in:
@@ -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::*;
|
||||
|
||||
Reference in New Issue
Block a user