Mercurial > molko
comparison libmlk-rpg/rpg/battle-entity.h @ 243:71b3b7036de7
misc: lot of cleanups,
- prefix libraries with libmlk,
- move assets from source directories closes #2520,
- prefix header guards closes #2519
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 28 Nov 2020 22:37:30 +0100 |
parents | librpg/rpg/battle-entity.h@86b71e1f9dd5 |
children | 08ab73b32832 |
comparison
equal
deleted
inserted
replaced
242:4c24604efcab | 243:71b3b7036de7 |
---|---|
1 /* | |
2 * battle-entity.h -- in game battle entity | |
3 * | |
4 * Copyright (c) 2020 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #ifndef MOLKO_RPG_BATTLE_ENTITY_H | |
20 #define MOLKO_RPG_BATTLE_ENTITY_H | |
21 | |
22 #include <stdbool.h> | |
23 | |
24 #include <ui/label.h> | |
25 | |
26 struct battle; | |
27 struct battle_entity_state; | |
28 struct character; | |
29 | |
30 /** | |
31 * \brief In battle entity. | |
32 */ | |
33 struct battle_entity { | |
34 struct character *ch; /*!< (+&?) Character to use. */ | |
35 int x; /*!< (+) Position on screen. */ | |
36 int y; /*!< (+) Position on screen. */ | |
37 struct label name; /*!< (*) Where its name label is located. */ | |
38 struct battle_entity_state *state; /*!< (+&) Update/draw state. */ | |
39 }; | |
40 | |
41 void | |
42 battle_entity_init(struct battle_entity *et); | |
43 | |
44 bool | |
45 battle_entity_ok(const struct battle_entity *et); | |
46 | |
47 void | |
48 battle_entity_switch(struct battle_entity *et, struct battle_entity_state *st); | |
49 | |
50 bool | |
51 battle_entity_update(struct battle_entity *et, unsigned int ticks); | |
52 | |
53 void | |
54 battle_entity_draw(const struct battle_entity *et, const struct battle *bt); | |
55 | |
56 void | |
57 battle_entity_draw_sprite(const struct battle_entity *et); | |
58 | |
59 void | |
60 battle_entity_finish(struct battle_entity *et); | |
61 | |
62 #endif /* !MOLKO_RPG_BATTLE_ENTITY_H */ |