Entity.h 963 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include <Critical.h>
  3. #include <Either.h>
  4. #include <Model3D.h>
  5. #include "Area.h"
  6. #include "EntityType.h"
  7. #include "FactoryCraftModel.h"
  8. class Block;
  9. struct MovementFrame
  10. {
  11. Framework::Vec3<float> position;
  12. float rotation;
  13. float duration;
  14. };
  15. class Entity : public FactoryCraftModel
  16. {
  17. private:
  18. int id;
  19. const EntityType* zType;
  20. bool playerControlled;
  21. Framework::Critical cs;
  22. MovementFrame currentFrame;
  23. Framework::Array<MovementFrame> frames;
  24. public:
  25. Entity(const EntityType* zType,
  26. Framework::Model3DData* model,
  27. Framework::Model3DTextur* texture,
  28. int id,
  29. Framework::Vec3<float> position,
  30. float size);
  31. ~Entity();
  32. void api(char* message);
  33. bool tick(double time) override;
  34. int getId() const;
  35. const EntityType* zEntityType() const;
  36. void lock();
  37. void unlock();
  38. void setPlayerControlled();
  39. };