#pragma once #include #include #include #include "EntityType.h" #include "Area.h" class Block; struct MovementFrame { Framework::Vec3 direction; Framework::Vec3 targetPosition; int movementFlags; double duration; }; class Entity : public Framework::Model3D { private: int id; const EntityType* zType; Framework::Critical cs; bool playerControlled; float maxMovementSpeed; int lastFlags; double timeSinceSync; Framework::Vec3 lastDirection; Framework::Array< MovementFrame > movements; Framework::Vec3 speed; MovementFrame currentFrame; public: Entity(const EntityType* zType, Framework::Model3DData* model, Framework::Model3DTextur* texture, int id, Framework::Vec3 position, float maxMovementSpeed); ~Entity(); void api(char* message); bool tick(double time) override; int getId() const; const EntityType* zEntityType() const; void lock(); void unlock(); void setPlayerControlled(); };