diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-20 19:29:41 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-20 19:29:41 +0200 |
commit | 1a45b0e0f5de785ddf268d7371f0cdaeafe9daa7 (patch) | |
tree | 5712d2d0784da660733e41d1b69636127b71c3b3 /server/src/entity | |
parent | 89ba8a6b62b90ac72547e2ca9ea5eeae7bbc6500 (diff) | |
download | hurrycurry-1a45b0e0f5de785ddf268d7371f0cdaeafe9daa7.tar hurrycurry-1a45b0e0f5de785ddf268d7371f0cdaeafe9daa7.tar.bz2 hurrycurry-1a45b0e0f5de785ddf268d7371f0cdaeafe9daa7.tar.zst |
refactor score code (and break things)
Diffstat (limited to 'server/src/entity')
-rw-r--r-- | server/src/entity/conveyor.rs | 2 | ||||
-rw-r--r-- | server/src/entity/customers/mod.rs | 8 | ||||
-rw-r--r-- | server/src/entity/portal.rs | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/server/src/entity/conveyor.rs b/server/src/entity/conveyor.rs index 6067c679..38478db7 100644 --- a/server/src/entity/conveyor.rs +++ b/server/src/entity/conveyor.rs @@ -72,7 +72,7 @@ impl EntityT for Conveyor { ItemLocation::Tile(self.from), Some(to.kind), &mut game.packet_out, - &mut game.points, + &mut game.score, true, ); } diff --git a/server/src/entity/customers/mod.rs b/server/src/entity/customers/mod.rs index 7a8280bc..e8679dc9 100644 --- a/server/src/entity/customers/mod.rs +++ b/server/src/entity/customers/mod.rs @@ -151,8 +151,8 @@ impl EntityT for Customers { ) .expect("no path to exit"); *self.chairs.get_mut(chair).unwrap() = true; - game.demands_failed += 1; - game.points -= 1; + game.score.demands_failed += 1; + game.score.points -= 1; game.score_changed = true; info!("{id:?} -> exiting"); *state = CustomerState::Exiting { path } @@ -232,8 +232,8 @@ impl EntityT for Customers { ) .ok_or(anyhow!("no path to exit"))?; *self.chairs.get_mut(chair).unwrap() = true; - game.demands_completed += 1; - game.points += demand.points; + game.score.demands_completed += 1; + game.score.points += demand.points; game.score_changed = true; info!("{id:?} -> exiting"); *state = CustomerState::Exiting { path } diff --git a/server/src/entity/portal.rs b/server/src/entity/portal.rs index 3aed35ac..2d4a762b 100644 --- a/server/src/entity/portal.rs +++ b/server/src/entity/portal.rs @@ -43,7 +43,7 @@ impl EntityT for Portal { ItemLocation::Tile(self.from), Some(to.kind), &mut game.packet_out, - &mut game.points, + &mut game.score, true, ); } |