summaryrefslogtreecommitdiffstats
path: root/src/World.hpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2023-07-08 21:41:27 +0200
committerGitHub <noreply@github.com>2023-07-08 21:41:27 +0200
commita68f48ad526d0843eb451af0be7f119db5ff794e (patch)
tree3c539c9e7de841c6616f532dadb7c8c1ef552d95 /src/World.hpp
parentMerge pull request #80 from LaG1924/ftr/better-water (diff)
parentFixed some errors detected by static analysis (diff)
downloadAltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar
AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar.gz
AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar.bz2
AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar.lz
AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar.xz
AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar.zst
AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.zip
Diffstat (limited to 'src/World.hpp')
-rw-r--r--src/World.hpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/World.hpp b/src/World.hpp
index 3e53efc..f7fcda2 100644
--- a/src/World.hpp
+++ b/src/World.hpp
@@ -30,14 +30,14 @@ struct Dimension {
bool skylight;
};
-void RegisterNewDimension(int dimensionId, Dimension newDimension);
+void RegisterNewDimension(int dimensionId, const Dimension& newDimension);
class World {
int dimension = 0;
std::map<Vector, std::shared_ptr<Section>> sections;
- Section ParseSection(StreamInput *data, Vector position);
+ Section ParseSection(StreamInput *data, const Vector& position);
std::list<Entity> entities;
@@ -61,11 +61,11 @@ public:
bool isPlayerCollides(double X, double Y, double Z) const;
- std::vector<Vector> GetSectionsList() const;
+ const std::vector<Vector>& GetSectionsList() const { return sectionsList; }
- const Section &GetSection(Vector sectionPos) const;
+ const Section &GetSection(const Vector& sectionPos) const;
- RaycastResult Raycast(glm::vec3 position, glm::vec3 direction) const;
+ RaycastResult Raycast(const glm::vec3& position, const glm::vec3& direction) const;
void UpdatePhysics(float delta);
@@ -77,25 +77,25 @@ public:
std::vector<unsigned int> GetEntitiesList() const;
- void AddEntity(Entity entity);
+ void AddEntity(const Entity& entity);
void DeleteEntity(unsigned int EntityId);
- BlockId GetBlockId(Vector pos) const;
+ BlockId GetBlockId(const Vector& pos) const;
- void SetBlockId(Vector pos, BlockId block);
+ void SetBlockId(const Vector& pos, BlockId block);
- void SetBlockLight(Vector pos, unsigned char light);
+ void SetBlockLight(const Vector& pos, unsigned char light);
- void SetBlockSkyLight(Vector pos, unsigned char light);
+ void SetBlockSkyLight(const Vector& pos, unsigned char light);
- const Section *GetSectionPtr(Vector position) const;
+ const Section *GetSectionPtr(const Vector& position) const;
- unsigned char GetBlockLight(Vector pos) const;
+ unsigned char GetBlockLight(const 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) 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) const;
- unsigned char GetBlockSkyLight(Vector pos) const;
+ unsigned char GetBlockSkyLight(const 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) 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) const;
}; \ No newline at end of file