source: trunk/src/entity.h @ 170

Last change on this file since 170 was 170, checked in by sam, 10 years ago

Properly implement program termination, including in the GTK program.

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1//
2// Deus Hax (working title)
3// Copyright (c) 2010 Sam Hocevar <sam@hocevar.net>
4//
5
6//
7// The Entity class
8// ---------------
9// Entities are objects that can be ticked by the game loop and/or the render
10// loop. Entities are implemented as one or several linked lists. See the
11// Ticker class for the ticking logic and the linked list implementation.
12//
13
14#if !defined __DH_ENTITY_H__
15#define __DH_ENTITY_H__
16
17#include <stdint.h>
18
19class Entity
20{
21    friend class Ticker;
22    friend class TickerData;
23    friend class Dict;
24
25protected:
26    typedef enum
27    {
28        GROUP_BEFORE = 0,
29        GROUP_DEFAULT,
30        GROUP_AFTER,
31        GROUP_DRAW_CAPTURE,
32        // Must be the last element
33        GROUP_COUNT
34    }
35    Group;
36
37    Entity();
38    virtual ~Entity();
39
40    virtual char const *GetName();
41    virtual Group GetGroup();
42
43    virtual void TickGame(float deltams);
44    virtual void TickDraw(float deltams);
45
46    Entity *next, *autonext;
47    int ref, autorelease, destroy;
48
49#if !FINAL_RELEASE
50    enum
51    {
52        STATE_IDLE = 0,
53        STATE_PRETICK_GAME,
54        STATE_POSTTICK_GAME,
55        STATE_PRETICK_DRAW,
56        STATE_POSTTICK_DRAW,
57    }
58    state;
59#endif
60};
61
62#endif // __DH_ENTITY_H__
63
Note: See TracBrowser for help on using the repository browser.