Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

66 řádky
1.2 KiB

  1. //
  2. // Deus Hax (working title)
  3. // Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
  4. //
  5. //
  6. // The Entity class
  7. // ---------------
  8. // Entities are objects that can be ticked by the game loop and/or the render
  9. // loop. Entities are implemented as one or several linked lists. See the
  10. // Ticker class for the ticking logic and the linked list implementation.
  11. //
  12. #if !defined __DH_ENTITY_H__
  13. #define __DH_ENTITY_H__
  14. #include <stdint.h>
  15. class Entity
  16. {
  17. friend class Ticker;
  18. friend class TickerData;
  19. public:
  20. virtual void Ref();
  21. virtual int Unref();
  22. protected:
  23. typedef enum
  24. {
  25. GROUP_BEFORE = 0,
  26. GROUP_DEFAULT,
  27. GROUP_AFTER,
  28. GROUP_RENDER_CAPTURE,
  29. // Must be the last element
  30. GROUP_COUNT
  31. }
  32. Group;
  33. Entity();
  34. virtual ~Entity();
  35. virtual Group GetGroup();
  36. virtual void TickGame(float delta_time);
  37. virtual void TickRender(float delta_time);
  38. Entity *next;
  39. int ref, destroy;
  40. #if !FINAL_RELEASE
  41. enum
  42. {
  43. STATE_IDLE = 0,
  44. STATE_PRETICK_GAME,
  45. STATE_POSTTICK_GAME,
  46. STATE_PRETICK_RENDER,
  47. STATE_POSTTICK_RENDER,
  48. }
  49. state;
  50. #endif
  51. };
  52. #endif // __DH_ENTITY_H__