No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

64 líneas
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. friend class Dict;
  20. protected:
  21. typedef enum
  22. {
  23. GROUP_BEFORE = 0,
  24. GROUP_DEFAULT,
  25. GROUP_AFTER,
  26. GROUP_DRAW_CAPTURE,
  27. // Must be the last element
  28. GROUP_COUNT
  29. }
  30. Group;
  31. Entity();
  32. virtual ~Entity();
  33. virtual char const *GetName();
  34. virtual Group GetGroup();
  35. virtual void TickGame(float deltams);
  36. virtual void TickDraw(float deltams);
  37. Entity *next, *autonext;
  38. int ref, autorelease, destroy;
  39. #if !FINAL_RELEASE
  40. enum
  41. {
  42. STATE_IDLE = 0,
  43. STATE_PRETICK_GAME,
  44. STATE_POSTTICK_GAME,
  45. STATE_PRETICK_DRAW,
  46. STATE_POSTTICK_DRAW,
  47. }
  48. state;
  49. #endif
  50. };
  51. #endif // __DH_ENTITY_H__