I have the following folder structure in a 2D terraria/Minecraft style game:
src/
- Backend/
- - Vector.hpp
- World/
- - Elements/
- - - Mobs/
- - - - BaseMob.cpp
As you would guess, there are plenty more source files within each directory. Inside BaseMob.cpp
I need to access src/Backend/Vector.hpp
. Is there either a cleaner way to write #include "../../../Backend/Vector.hpp"
(ie. #include "/Backend/Vector.hpp"
) or a better way to organize the files in my source folder?
Here's some more info on the actual content in the source folders (most .cpp
files are excluded):
Backend/ # Anything specific to a particular platform
- Vector.hpp
- Graphics.hpp
World/ # Anything about the whole game's world
- Elements/
- - Mobs/
- - - BaseMob.hpp # Polymorphic base class
- - - MobHandler.hpp # Manages all mobs in world
- - - PlayerMob.hpp
- - - WaterMob.hpp
- - Block.hpp # Defines all possible blocks
- - Inventory.hpp
- - Furnace.hpp
- World.hpp
- WorldRenderer.hpp # Makes calls to Backend/graphics.hpp
main.cpp