1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #pragma once
- #include <Model3D.h>
- #include <Either.h>
- #include <Critical.h>
- #include "EntityType.h"
- #include "Area.h"
- class Block;
- struct MovementFrame
- {
- Framework::Vec3<float> direction;
- Framework::Vec3<float> 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<float> lastDirection;
- Framework::Array< MovementFrame > movements;
- Framework::Vec3<float> speed;
- MovementFrame currentFrame;
- public:
- Entity(const EntityType* zType, Framework::Model3DData* model, Framework::Model3DTextur* texture, int id, Framework::Vec3<float> 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();
- };
|