source: trunk/src/entity.cpp @ 686

Last change on this file since 686 was 686, checked in by sam, 9 years ago

Put everything in the "lol" namespace. Better late than never.

  • Property svn:keywords set to Id
File size: 1.3 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#if defined HAVE_CONFIG_H
12#   include "config.h"
13#endif
14
15#include <cstdlib>
16#include <cstdio>
17
18#include "core.h"
19
20namespace lol
21{
22
23/*
24 * Public Entity class
25 */
26
27Entity::Entity() :
28    gamenext(0),
29    drawnext(0),
30    ref(0),
31    destroy(0)
32{
33#if !LOL_RELEASE
34    state = STATE_IDLE;
35#endif
36    gamegroup = GAMEGROUP_DEFAULT;
37    drawgroup = DRAWGROUP_DEFAULT;
38    Ticker::Register(this);
39}
40
41Entity::~Entity()
42{
43#if !LOL_RELEASE
44    if (!destroy)
45        fprintf(stderr, "ERROR: entity destructor called directly\n");
46#endif
47}
48
49char const *Entity::GetName()
50{
51    return "<entity>";
52}
53
54void Entity::TickGame(float deltams)
55{
56#if !LOL_RELEASE
57    if (state != STATE_PRETICK_GAME)
58        fprintf(stderr, "ERROR: invalid entity game tick\n");
59    state = STATE_POSTTICK_GAME;
60#endif
61}
62
63void Entity::TickDraw(float deltams)
64{
65#if !LOL_RELEASE
66    if (state != STATE_PRETICK_DRAW)
67        fprintf(stderr, "ERROR: invalid entity draw tick\n");
68    state = STATE_POSTTICK_DRAW;
69#endif
70}
71
72} /* namespace lol */
73
Note: See TracBrowser for help on using the repository browser.