Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

84 Zeilen
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. inline int IsDestroying() { return destroy; }
  30. virtual void TickGame(float deltams);
  31. virtual void TickDraw(float deltams);
  32. enum
  33. {
  34. GAMEGROUP_BEFORE = 0,
  35. GAMEGROUP_DEFAULT,
  36. GAMEGROUP_AFTER,
  37. // Must be the last element
  38. GAMEGROUP_END
  39. }
  40. gamegroup;
  41. enum
  42. {
  43. DRAWGROUP_BEFORE = GAMEGROUP_END,
  44. DRAWGROUP_DEFAULT,
  45. DRAWGROUP_HUD,
  46. DRAWGROUP_CAPTURE,
  47. // Must be the last element
  48. DRAWGROUP_END
  49. }
  50. drawgroup;
  51. static int const GAMEGROUP_BEGIN = 0;
  52. static int const DRAWGROUP_BEGIN = GAMEGROUP_END;
  53. static int const ALLGROUP_END = DRAWGROUP_END;
  54. #if !FINAL_RELEASE
  55. enum
  56. {
  57. STATE_IDLE = 0,
  58. STATE_PRETICK_GAME,
  59. STATE_POSTTICK_GAME,
  60. STATE_PRETICK_DRAW,
  61. STATE_POSTTICK_DRAW,
  62. }
  63. state;
  64. #endif
  65. private:
  66. Entity *gamenext, *drawnext, *autonext;
  67. int ref, autorelease, destroy;
  68. };
  69. #endif // __DH_ENTITY_H__