12345678910111213141516171819202122232425262728293031323334 |
- #ifndef WORLD_H
- #define WORLD_H
- #include "common/entities/Entity.h"
- #include "common/world/BlockStorage.h"
- #include "utils/List.h"
- class World final {
- BlockStorage blocks;
- List<Entity*> entities;
- public:
- mutable bool dirty;
- World();
- void setBlock(int x, int y, int z, Block::Id block);
- Block::Id getBlock(int x, int y, int z) const;
- int getSize() const;
- int getHeight() const;
- void addEntity(Entity* e);
- void removeEntity(Entity* e);
- void tick();
- Vector3 limitMove(const Entity& e, Vector3 move) const;
- private:
- List<Box> getBoxes(const Box& box) const;
- };
- #endif
|