1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- #pragma once
- #include <Welt3D.h>
- #include <Bildschirm.h>
- #include <Kam3D.h>
- #include <Thread.h>
- #include "Dimension.h"
- #include "PlayerKam.h"
- #include "FactoryClient.h"
- class World : public Framework::Thread
- {
- public:
- static World* INSTANCE;
-
- private:
- Dimension* currentDimension;
- Framework::Welt3D* renderedWorld;
- Framework::Bildschirm3D* zScreenPtr;
- PlayerKam* kam;
- bool firstMessage;
- int ownEntityId;
- Framework::Model3D* currentTarget;
- Array<Punkt> subscriptions;
- FactoryClient* client;
- Critical subLock;
- Critical targetLock;
- public:
- World(Framework::Bildschirm3D* zScreen, FactoryClient* client);
- ~World();
- void update(bool background);
- void setChunk(Chunk* chunk);
- void thread() override;
- Block* zBlockAt(Framework::Vec3<int> location) const;
- Block* getBlockAt(Framework::Vec3<int> location) const;
- Dimension* zDimension() const;
- void setVisibility(Chunk* zChunk, bool visible);
- void setVisibility(Entity* zEntity, bool visible);
- Framework::Punkt getChunkCenter(int x, int y) const;
- Entity* zEntity(int id) const;
- Entity* getEntity(int id) const;
- void removeEntity(int id);
- PlayerKam* zKamera() const;
- int getCurrentPlayerId() const;
- Entity* getCurrentPlayerEntity() const;
- void setTarget(Framework::Model3D* zTarget);
- void lockWorld();
- void unlockWorld();
- void onChunkAdded(Punkt pos);
- Chunk* zChunk(Punkt center);
- Framework::Model3D* getCurrentTarget() const;
- FactoryClient* zClient() const;
- };
|