Merge branch 'master' of ssh://mnml.gg:40022/~/mnml

This commit is contained in:
ntr 2019-06-06 13:19:46 +10:00
commit 8fce64c0a7

View File

@ -66,16 +66,19 @@ impl Player {
pub fn add_win(&mut self) -> &mut Player { pub fn add_win(&mut self) -> &mut Player {
self.wins += 1; self.wins += 1;
self.vbox.balance_add(12); let win_bonus = 12 + 6 * (self.wins + self.losses);
self.vbox.balance_add(win_bonus.into());
self self
} }
pub fn add_loss(&mut self) -> &mut Player { pub fn add_loss(&mut self) -> &mut Player {
self.losses += 1; self.losses += 1;
self.vbox.balance_add(9); let loss_bonus = 12 + 6 * (self.wins + self.losses);
self.vbox.balance_add(loss_bonus.into());
self self
} }
pub fn construct_get(&mut self, id: Uuid) -> Result<&mut Construct, Error> { pub fn construct_get(&mut self, id: Uuid) -> Result<&mut Construct, Error> {
self.constructs.iter_mut().find(|c| c.id == id).ok_or(err_msg("construct not found")) self.constructs.iter_mut().find(|c| c.id == id).ok_or(err_msg("construct not found"))
} }