World.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include <Welt3D.h>
  3. #include <Bildschirm.h>
  4. #include <Kam3D.h>
  5. #include <Thread.h>
  6. #include "Dimension.h"
  7. #include "PlayerKam.h"
  8. class World : public Framework::Thread
  9. {
  10. private:
  11. Dimension* currentDimension;
  12. Framework::Welt3D* renderedWorld;
  13. Framework::Bildschirm3D* zScreenPtr;
  14. PlayerKam* kam;
  15. Framework::Vec3<int> target;
  16. int entityTarget;
  17. bool hasTarget;
  18. bool firstMessage;
  19. int ownEntityId;
  20. Framework::Model3D* currentTarget;
  21. Array<Punkt> subscriptions;
  22. Critical subLock;
  23. public:
  24. World(Framework::Bildschirm3D* zScreen);
  25. ~World();
  26. void update(bool background);
  27. void setChunk(Chunk* chunk);
  28. void thread() override;
  29. Block* zBlockAt(Framework::Vec3<int> location) const;
  30. Block* getBlockAt(Framework::Vec3<int> location) const;
  31. Dimension* zDimension() const;
  32. void setVisibility(Chunk* zChunk, bool visible);
  33. void setVisibility(Entity* zEntity, bool visible);
  34. Framework::Punkt getChunkCenter(int x, int y) const;
  35. Entity* zEntity(int id) const;
  36. Entity* getEntity(int id) const;
  37. void removeEntity(int id);
  38. PlayerKam* zKamera() const;
  39. int getCurrentPlayerId() const;
  40. Entity* getCurrentPlayerEntity() const;
  41. void setTarget(Framework::Model3D* zTarget);
  42. void lockWorld();
  43. void unlockWorld();
  44. void onChunkAdded(Punkt pos);
  45. };