aboutsummaryrefslogtreecommitdiff
path: root/server/src/entity/pedestrians.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-06-03 20:24:20 +0200
committermetamuffin <metamuffin@disroot.org>2025-06-03 20:24:20 +0200
commitd279baccdbaf37ae4410af1875e98597fe0b5565 (patch)
treee42320d5c0433a6b0415305da0520dc035553cef /server/src/entity/pedestrians.rs
parentdb4587d3ec64b7e28691b43f9d9701939eed94d1 (diff)
downloadhurrycurry-d279baccdbaf37ae4410af1875e98597fe0b5565.tar
hurrycurry-d279baccdbaf37ae4410af1875e98597fe0b5565.tar.bz2
hurrycurry-d279baccdbaf37ae4410af1875e98597fe0b5565.tar.zst
use multiple ints for characters; close #294
Diffstat (limited to 'server/src/entity/pedestrians.rs')
-rw-r--r--server/src/entity/pedestrians.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/server/src/entity/pedestrians.rs b/server/src/entity/pedestrians.rs
index 9b433ded..64adf57b 100644
--- a/server/src/entity/pedestrians.rs
+++ b/server/src/entity/pedestrians.rs
@@ -1,5 +1,3 @@
-use std::collections::HashMap;
-
/*
Hurry Curry! - a game about cooking
Copyright 2025 metamuffin
@@ -19,9 +17,10 @@ use std::collections::HashMap;
*/
use super::{Entity, EntityContext};
use anyhow::Result;
-use hurrycurry_protocol::{glam::Vec2, PacketS, PlayerClass, PlayerID};
+use hurrycurry_protocol::{glam::Vec2, Character, PacketS, PlayerClass, PlayerID};
use rand::{random, rng};
use rand_distr::Distribution;
+use std::collections::HashMap;
pub struct Pedestrians {
pub players: HashMap<PlayerID, usize>,
@@ -40,7 +39,11 @@ impl Entity for Pedestrians {
let id = PlayerID(random());
c.packet_in.push_back(PacketS::Join {
name: "Pedestrian".to_string(),
- character: 0,
+ character: Character {
+ color: random(),
+ hairstyle: random(),
+ headwear: 0,
+ },
class: PlayerClass::Customer,
id: Some(id),
position: self.points.get(0).copied(),