Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

77 строки
1.5 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. Entity();
  22. virtual ~Entity();
  23. virtual char const *GetName();
  24. virtual void TickGame(float deltams);
  25. virtual void TickDraw(float deltams);
  26. Entity *gamenext, *drawnext, *autonext;
  27. int ref, autorelease, destroy;
  28. enum
  29. {
  30. GAMEGROUP_BEFORE = 0,
  31. GAMEGROUP_DEFAULT,
  32. GAMEGROUP_AFTER,
  33. // Must be the last element
  34. GAMEGROUP_END
  35. }
  36. gamegroup;
  37. enum
  38. {
  39. DRAWGROUP_BEFORE = GAMEGROUP_END,
  40. DRAWGROUP_DEFAULT,
  41. DRAWGROUP_HUD,
  42. DRAWGROUP_CAPTURE,
  43. // Must be the last element
  44. DRAWGROUP_END
  45. }
  46. drawgroup;
  47. static int const GAMEGROUP_BEGIN = 0;
  48. static int const DRAWGROUP_BEGIN = GAMEGROUP_END;
  49. static int const ALLGROUP_END = DRAWGROUP_END;
  50. #if !FINAL_RELEASE
  51. enum
  52. {
  53. STATE_IDLE = 0,
  54. STATE_PRETICK_GAME,
  55. STATE_POSTTICK_GAME,
  56. STATE_PRETICK_DRAW,
  57. STATE_POSTTICK_DRAW,
  58. }
  59. state;
  60. #endif
  61. };
  62. #endif // __DH_ENTITY_H__