From 458e0005690ea9d579588a0a12368fc2c2c9a93a Mon Sep 17 00:00:00 2001 From: untodesu Date: Tue, 1 Jul 2025 03:08:39 +0500 Subject: I hyper-focued on refactoring again - I put a cool-sounding "we are number one" remix on repeat and straight up grinded the entire repository to a better state until 03:09 AM. I guess I have something wrong in my brain that makes me do this shit --- src/game/shared/dimension.hh | 85 -------------------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 src/game/shared/dimension.hh (limited to 'src/game/shared/dimension.hh') diff --git a/src/game/shared/dimension.hh b/src/game/shared/dimension.hh deleted file mode 100644 index 398a4ce..0000000 --- a/src/game/shared/dimension.hh +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef SHARED_DIMENSION_HH -#define SHARED_DIMENSION_HH 1 -#pragma once - -#include "shared/const.hh" -#include "shared/types.hh" - -class Chunk; -class Config; -class VoxelStorage; - -using dimension_entropy_map = std::array; -using dimension_height_map = std::array; - -class Dimension { -public: - explicit Dimension(const char* name, float gravity); - virtual ~Dimension(void); - - const char* get_name(void) const; - float get_gravity(void) const; - -public: - Chunk* create_chunk(const chunk_pos& cpos); - Chunk* find_chunk(entt::entity entity) const; - Chunk* find_chunk(const chunk_pos& cpos) const; - - void remove_chunk(entt::entity entity); - void remove_chunk(const chunk_pos& cpos); - void remove_chunk(Chunk* chunk); - -public: - voxel_id get_voxel(const voxel_pos& vpos) const; - voxel_id get_voxel(const chunk_pos& cpos, const local_pos& lpos) const; - - bool set_voxel(voxel_id voxel, const voxel_pos& vpos); - bool set_voxel(voxel_id voxel, const chunk_pos& cpos, const local_pos& lpos); - -public: - virtual void init(Config& config); - virtual void init_late(std::uint64_t global_seed); - virtual bool generate(const chunk_pos& cpos, VoxelStorage& voxels); - -public: - entt::registry chunks; - entt::registry entities; - -private: - std::string m_name; - emhash8::HashMap m_chunkmap; - float m_gravity; -}; - -struct ChunkComponent final { - chunk_pos cpos; - Chunk* chunk; -}; - -struct ChunkCreateEvent final { - Dimension* dimension; - chunk_pos cpos; - Chunk* chunk; -}; - -struct ChunkDestroyEvent final { - Dimension* dimension; - chunk_pos cpos; - Chunk* chunk; -}; - -struct ChunkUpdateEvent final { - Dimension* dimension; - chunk_pos cpos; - Chunk* chunk; -}; - -struct VoxelSetEvent final { - Dimension* dimension; - chunk_pos cpos; - local_pos lpos; - voxel_id voxel; - Chunk* chunk; -}; - -#endif // SHARED_DIMENSION_HH -- cgit