Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

82 wiersze
1.8 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://sam.zoy.org/projects/COPYING.WTFPL for more details.
  9. //
  10. //
  11. // The Entity class
  12. // ---------------
  13. // Entities are objects that can be ticked by the game loop and/or the render
  14. // loop. Entities are implemented as one or several linked lists. See the
  15. // Ticker class for the ticking logic and the linked list implementation.
  16. //
  17. #if !defined __DH_ENTITY_H__
  18. #define __DH_ENTITY_H__
  19. #include <stdint.h>
  20. class Entity
  21. {
  22. friend class Ticker;
  23. friend class TickerData;
  24. friend class Dict;
  25. protected:
  26. Entity();
  27. virtual ~Entity();
  28. virtual char const *GetName();
  29. virtual void TickGame(float deltams);
  30. virtual void TickDraw(float deltams);
  31. Entity *gamenext, *drawnext, *autonext;
  32. int ref, autorelease, destroy;
  33. enum
  34. {
  35. GAMEGROUP_BEFORE = 0,
  36. GAMEGROUP_DEFAULT,
  37. GAMEGROUP_AFTER,
  38. // Must be the last element
  39. GAMEGROUP_END
  40. }
  41. gamegroup;
  42. enum
  43. {
  44. DRAWGROUP_BEFORE = GAMEGROUP_END,
  45. DRAWGROUP_DEFAULT,
  46. DRAWGROUP_HUD,
  47. DRAWGROUP_CAPTURE,
  48. // Must be the last element
  49. DRAWGROUP_END
  50. }
  51. drawgroup;
  52. static int const GAMEGROUP_BEGIN = 0;
  53. static int const DRAWGROUP_BEGIN = GAMEGROUP_END;
  54. static int const ALLGROUP_END = DRAWGROUP_END;
  55. #if !FINAL_RELEASE
  56. enum
  57. {
  58. STATE_IDLE = 0,
  59. STATE_PRETICK_GAME,
  60. STATE_POSTTICK_GAME,
  61. STATE_PRETICK_DRAW,
  62. STATE_POSTTICK_DRAW,
  63. }
  64. state;
  65. #endif
  66. };
  67. #endif // __DH_ENTITY_H__