source: trunk/src/entity.h @ 221

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

Complete Lol Engine / Deus Hax / Monsterz split.

  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
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//
12// The Entity class
13// ---------------
14// Entities are objects that can be ticked by the game loop and/or the render
15// loop. Entities are implemented as one or several linked lists. See the
16// Ticker class for the ticking logic and the linked list implementation.
17//
18
19#if !defined __DH_ENTITY_H__
20#define __DH_ENTITY_H__
21
22#include <stdint.h>
23
24class Entity
25{
26    friend class Ticker;
27    friend class TickerData;
28    friend class Dict;
29
30protected:
31    Entity();
32    virtual ~Entity();
33
34    virtual char const *GetName();
35
36    virtual void TickGame(float deltams);
37    virtual void TickDraw(float deltams);
38
39    Entity *gamenext, *drawnext, *autonext;
40    int ref, autorelease, destroy;
41
42    enum
43    {
44        GAMEGROUP_BEFORE = 0,
45        GAMEGROUP_DEFAULT,
46        GAMEGROUP_AFTER,
47        // Must be the last element
48        GAMEGROUP_END
49    }
50    gamegroup;
51
52    enum
53    {
54        DRAWGROUP_BEFORE = GAMEGROUP_END,
55        DRAWGROUP_DEFAULT,
56        DRAWGROUP_HUD,
57        DRAWGROUP_CAPTURE,
58        // Must be the last element
59        DRAWGROUP_END
60    }
61    drawgroup;
62
63    static int const GAMEGROUP_BEGIN = 0;
64    static int const DRAWGROUP_BEGIN = GAMEGROUP_END;
65    static int const ALLGROUP_END = DRAWGROUP_END;
66
67#if !FINAL_RELEASE
68    enum
69    {
70        STATE_IDLE = 0,
71        STATE_PRETICK_GAME,
72        STATE_POSTTICK_GAME,
73        STATE_PRETICK_DRAW,
74        STATE_POSTTICK_DRAW,
75    }
76    state;
77#endif
78};
79
80#endif // __DH_ENTITY_H__
81
Note: See TracBrowser for help on using the repository browser.