source: trunk/src/entity.h @ 328

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

Make Entity variable members private.

  • Property svn:keywords set to Id
File size: 1.8 KB
RevLine 
[100]1//
[221]2// Lol Engine
[100]3//
[221]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//
[94]10
[100]11//
[147]12// The Entity class
[100]13// ---------------
[147]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
[100]16// Ticker class for the ticking logic and the linked list implementation.
17//
[94]18
[147]19#if !defined __DH_ENTITY_H__
20#define __DH_ENTITY_H__
[94]21
22#include <stdint.h>
23
[147]24class Entity
[94]25{
26    friend class Ticker;
[101]27    friend class TickerData;
[153]28    friend class Dict;
[94]29
[96]30protected:
[147]31    Entity();
32    virtual ~Entity();
[106]33
[153]34    virtual char const *GetName();
[328]35    inline int IsDestroying() { return destroy; }
[101]36
[149]37    virtual void TickGame(float deltams);
[154]38    virtual void TickDraw(float deltams);
[101]39
[210]40    enum
41    {
42        GAMEGROUP_BEFORE = 0,
43        GAMEGROUP_DEFAULT,
44        GAMEGROUP_AFTER,
45        // Must be the last element
46        GAMEGROUP_END
47    }
48    gamegroup;
49
50    enum
51    {
52        DRAWGROUP_BEFORE = GAMEGROUP_END,
53        DRAWGROUP_DEFAULT,
54        DRAWGROUP_HUD,
55        DRAWGROUP_CAPTURE,
56        // Must be the last element
57        DRAWGROUP_END
58    }
59    drawgroup;
60
61    static int const GAMEGROUP_BEGIN = 0;
62    static int const DRAWGROUP_BEGIN = GAMEGROUP_END;
63    static int const ALLGROUP_END = DRAWGROUP_END;
64
[130]65#if !FINAL_RELEASE
66    enum
67    {
68        STATE_IDLE = 0,
69        STATE_PRETICK_GAME,
70        STATE_POSTTICK_GAME,
[154]71        STATE_PRETICK_DRAW,
72        STATE_POSTTICK_DRAW,
[130]73    }
74    state;
75#endif
[328]76
77private:
78    Entity *gamenext, *drawnext, *autonext;
79    int ref, autorelease, destroy;
[94]80};
81
[147]82#endif // __DH_ENTITY_H__
[94]83
Note: See TracBrowser for help on using the repository browser.