diff options
author | metamuffin <metamuffin@disroot.org> | 2025-09-30 01:19:01 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-09-30 01:19:09 +0200 |
commit | 5033c326094edc1ff4234b994e95d987cb937fc4 (patch) | |
tree | 5fa426a77109722df163c15ce8d647170cd8fcea /server/protocol/src/lib.rs | |
parent | 727752b87bbe7146adb0f9e9e27d6e64b785ec2f (diff) | |
download | hurrycurry-5033c326094edc1ff4234b994e95d987cb937fc4.tar hurrycurry-5033c326094edc1ff4234b994e95d987cb937fc4.tar.bz2 hurrycurry-5033c326094edc1ff4234b994e95d987cb937fc4.tar.zst |
Implement tile placeable items for server-side (#433)
Diffstat (limited to 'server/protocol/src/lib.rs')
-rw-r--r-- | server/protocol/src/lib.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs index c32bff39..00ef62d7 100644 --- a/server/protocol/src/lib.rs +++ b/server/protocol/src/lib.rs @@ -17,7 +17,10 @@ */ use glam::{IVec2, Vec2}; use serde::{Deserialize, Deserializer, Serialize}; -use std::{collections::HashSet, sync::LazyLock}; +use std::{ + collections::{BTreeMap, HashSet}, + sync::LazyLock, +}; pub use glam; @@ -76,14 +79,14 @@ pub struct Demand { pub points: i64, } -#[derive(Debug, Clone, Serialize, Deserialize, Default)] +#[derive(Debug, Clone, Serialize, Deserialize, Default)] #[rustfmt::skip] pub struct Gamedata { pub current_map: String, pub item_names: Vec<String>, pub tile_names: Vec<String>, - pub tile_collide: Vec<bool>, - pub tile_interact: Vec<bool>, + pub tile_walkable: HashSet<TileIndex>, + pub tile_placeable_items: BTreeMap<TileIndex, HashSet<ItemIndex>>, pub maps: Vec<(String, MapMetadata)>, pub bot_algos: Vec<String>, pub recipes: Vec<Recipe>, |