Inspect World as well

This commit is contained in:
crumblingstatue 2023-04-07 00:50:15 +02:00
parent a11d69eee2
commit 3938654843
3 changed files with 7 additions and 7 deletions

4
Cargo.lock generated
View file

@ -192,7 +192,7 @@ dependencies = [
[[package]]
name = "egui-inspect"
version = "0.1.0"
source = "git+https://github.com/crumblingstatue/egui-inspect.git#135c81eb0264ddbec69f98b0a9d5c7ec22867736"
source = "git+https://github.com/crumblingstatue/egui-inspect.git#5cf1f05c0f4f6625eb9a46ee0faebdb27919f9bf"
dependencies = [
"egui",
"egui-inspect-derive",
@ -201,7 +201,7 @@ dependencies = [
[[package]]
name = "egui-inspect-derive"
version = "0.1.0"
source = "git+https://github.com/crumblingstatue/egui-inspect.git#135c81eb0264ddbec69f98b0a9d5c7ec22867736"
source = "git+https://github.com/crumblingstatue/egui-inspect.git#5cf1f05c0f4f6625eb9a46ee0faebdb27919f9bf"
dependencies = [
"proc-macro2",
"quote",

View file

@ -26,7 +26,6 @@ use self::player::Player;
#[derivative(Debug)]
pub struct GameState {
pub camera_offset: WorldPos,
#[opaque]
pub world: World,
pub player: Player,
pub gravity: f32,

View file

@ -1,16 +1,17 @@
use egui_inspect::derive::Inspect;
use fnv::FnvHashMap;
use crate::worldgen::Worldgen;
pub type ChunkPosScalar = u16;
#[derive(Hash, PartialEq, Eq, Debug, Clone, Copy)]
#[derive(Hash, PartialEq, Eq, Debug, Clone, Copy, Inspect)]
pub struct ChunkPos {
pub x: ChunkPosScalar,
pub y: ChunkPosScalar,
}
#[derive(Default, Debug)]
#[derive(Default, Debug, Inspect)]
pub struct World {
/// The currently loaded chunks
chunks: FnvHashMap<ChunkPos, Chunk>,
@ -99,7 +100,7 @@ const CHUNK_N_TILES: usize = CHUNK_EXTENT as usize * CHUNK_EXTENT as usize;
type ChunkTiles = [Tile; CHUNK_N_TILES];
#[derive(Debug)]
#[derive(Debug, Inspect)]
pub struct Chunk {
tiles: ChunkTiles,
}
@ -136,7 +137,7 @@ impl Chunk {
pub type TileId = u16;
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Inspect)]
pub struct Tile {
/// Background wall behind entities
pub bg: TileId,