mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-15 20:25:00 +01:00
Inspect World as well
This commit is contained in:
parent
a11d69eee2
commit
3938654843
3 changed files with 7 additions and 7 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue