[refactor] Sync with master

This was initially a merge commit that got ironed out by rebase cleanup.
Notable changes are:
- Copying EntityRef instead of referencing it
- Some changes to includes
This commit is contained in:
gsemaj
2022-07-30 22:50:03 -07:00
committed by gsemaj
parent 31677e2638
commit 4ece1bb89b
6 changed files with 22 additions and 30 deletions

View File

@@ -1,13 +1,11 @@
#pragma once
#include "Entities.hpp"
#include "EntityRef.hpp"
#include <set>
#include <map>
#include <vector>
struct EntityRef;
class Chunk {
public:
std::set<EntityRef> entities;
@@ -34,13 +32,13 @@ namespace Chunking {
extern const ChunkPos INVALID_CHUNK;
void updateEntityChunk(const EntityRef& ref, ChunkPos from, ChunkPos to);
void updateEntityChunk(const EntityRef ref, ChunkPos from, ChunkPos to);
void trackEntity(ChunkPos chunkPos, const EntityRef& ref);
void untrackEntity(ChunkPos chunkPos, const EntityRef& ref);
void trackEntity(ChunkPos chunkPos, const EntityRef ref);
void untrackEntity(ChunkPos chunkPos, const EntityRef ref);
void addEntityToChunks(std::set<Chunk*> chnks, const EntityRef& ref);
void removeEntityFromChunks(std::set<Chunk*> chnks, const EntityRef& ref);
void addEntityToChunks(std::set<Chunk*> chnks, const EntityRef ref);
void removeEntityFromChunks(std::set<Chunk*> chnks, const EntityRef ref);
bool chunkExists(ChunkPos chunk);
ChunkPos chunkPosAt(int posX, int posY, uint64_t instanceID);