comparison src/libmlk-adventure/adventure/molko.h @ 320:8f9937403749

misc: improve loading of data
author David Demelier <markand@malikania.fr>
date Fri, 01 Oct 2021 20:30:00 +0200
parents libmlk-adventure/adventure/molko.h@d01e83210ca2
children
comparison
equal deleted inserted replaced
319:b843eef4cc35 320:8f9937403749
1 /*
2 * molko.h -- main structure for Molko's Adventure
3 *
4 * Copyright (c) 2020-2021 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_ADVENTURE_MOLKO_H
20 #define MOLKO_ADVENTURE_MOLKO_H
21
22 #include <core/core.h>
23 #include <core/game.h>
24 #include <core/texture.h>
25 #include <core/sprite.h>
26
27 #include <rpg/inventory.h>
28 #include <rpg/team.h>
29
30 struct battle;
31
32 enum molko_state {
33 MOLKO_STATE_MAP,
34 MOLKO_STATE_BATTLE,
35 };
36
37 struct molko {
38 struct state *panic;
39
40 /* Make sure to set this accordingly when changing states. */
41 enum molko_state state;
42
43 struct team team;
44 struct inventory inventory;
45
46 /* For map state. */
47 struct texture map_player_texture;
48 struct sprite map_player_sprite;
49 };
50
51 CORE_BEGIN_DECLS
52
53 extern struct molko molko;
54
55 void
56 molko_init(void);
57
58 void
59 molko_run(void);
60
61 void
62 molko_teleport(const char *map, int origin_x, int origin_y);
63
64 void
65 molko_fight(struct battle *bt);
66
67 const char *
68 molko_path(const char *file);
69
70 void
71 molko_finish(void);
72
73 CORE_END_DECLS
74
75 #endif /* !MOLKO_ADVENTURE_MOLKO_H */