aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-20 19:29:41 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-20 19:29:41 +0200
commit1a45b0e0f5de785ddf268d7371f0cdaeafe9daa7 (patch)
tree5712d2d0784da660733e41d1b69636127b71c3b3 /server/src/entity
parent89ba8a6b62b90ac72547e2ca9ea5eeae7bbc6500 (diff)
downloadhurrycurry-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.rs2
-rw-r--r--server/src/entity/customers/mod.rs8
-rw-r--r--server/src/entity/portal.rs2
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,
);
}