From 5f010b71415a7dc0337c67cac4666eacdf472751 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 27 Jan 2019 11:25:45 +0500 Subject: Added const-keyword to World --- src/World.hpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'src/World.hpp') diff --git a/src/World.hpp b/src/World.hpp index 591e7a7..6c9a615 100644 --- a/src/World.hpp +++ b/src/World.hpp @@ -48,13 +48,13 @@ public: void ParseChunkData(std::shared_ptr packet); - bool isPlayerCollides(double X, double Y, double Z); + bool isPlayerCollides(double X, double Y, double Z) const; - std::vector GetSectionsList(); + std::vector GetSectionsList() const; - const Section &GetSection(Vector sectionPos); + const Section &GetSection(Vector sectionPos) const; - RaycastResult Raycast(glm::vec3 position, glm::vec3 direction); + RaycastResult Raycast(glm::vec3 position, glm::vec3 direction) const; void UpdatePhysics(float delta); @@ -62,13 +62,15 @@ public: Entity* GetEntityPtr(unsigned int EntityId); - std::vector GetEntitiesList(); + const Entity& GetEntity(unsigned int EntityId) const; + + std::vector GetEntitiesList() const; void AddEntity(Entity entity); void DeleteEntity(unsigned int EntityId); - BlockId GetBlockId(Vector pos); + BlockId GetBlockId(Vector pos) const; void SetBlockId(Vector pos, BlockId block); @@ -76,13 +78,13 @@ public: void SetBlockSkyLight(Vector pos, unsigned char light); - Section *GetSectionPtr(Vector position); + const Section *GetSectionPtr(Vector position) const; - unsigned char GetBlockLight(Vector pos); + unsigned char GetBlockLight(Vector pos) const; - unsigned char GetBlockLight(const Vector &blockPos, const Section *section, const Section *xp, const Section *xn, const Section *yp, const Section *yn, const Section *zp, const Section *zn); + unsigned char GetBlockLight(const Vector &blockPos, const Section *section, const Section *xp, const Section *xn, const Section *yp, const Section *yn, const Section *zp, const Section *zn) const; - unsigned char GetBlockSkyLight(Vector pos); + unsigned char GetBlockSkyLight(Vector pos) const; - unsigned char GetBlockSkyLight(const Vector &blockPos, const Section *section, const Section *xp, const Section *xn, const Section *yp, const Section *yn, const Section *zp, const Section *zn); + unsigned char GetBlockSkyLight(const Vector &blockPos, const Section *section, const Section *xp, const Section *xn, const Section *yp, const Section *yn, const Section *zp, const Section *zn) const; }; \ No newline at end of file -- cgit v1.2.3