comparison libmlk-adventure/adventure/action/chest.h @ 272:a49ae1b6ea4f

adventure: don't use plural in directories
author David Demelier <markand@malikania.fr>
date Sat, 12 Dec 2020 12:16:47 +0100
parents libmlk-adventure/adventure/actions/chest.h@eadd3dbfa0af
children e28429dbdaaf
comparison
equal deleted inserted replaced
271:eadd3dbfa0af 272:a49ae1b6ea4f
1 /*
2 * chest.h -- chest object
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_ADVENTURE_ACTIONS_CHEST_H
20 #define MOLKO_ADVENTURE_ACTIONS_CHEST_H
21
22 #include <core/action.h>
23 #include <core/animation.h>
24
25 struct map;
26 struct sound;
27
28 enum chest_state {
29 CHEST_STATE_CLOSED,
30 CHEST_STATE_ANIMATE,
31 CHEST_STATE_OPEN
32 };
33
34 struct chest {
35 /* Mandatory. */
36 int x;
37 int y;
38 struct map *map;
39 struct animation animation;
40
41 /* Defaulted. */
42 enum chest_state state;
43 struct action action;
44
45 /* Optional. */
46 struct save *save;
47 struct save_property *property;
48 struct sound *sound;
49 void *data;
50 void (*exec)(struct chest *);
51 };
52
53 void
54 chest_init(struct chest *c);
55
56 struct action *
57 chest_action(struct chest *c);
58
59 #endif /* !MOLKO_ADVENTURE_ACTIONS_CHEST_H */