annotate libmlk-core/core/state.h @ 253:c4da052c0def

core: goodbye doxygen
author David Demelier <markand@malikania.fr>
date Thu, 03 Dec 2020 09:06:52 +0100
parents 71b3b7036de7
children 08ab73b32832
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
44
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
1 /*
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
2 * state.h -- abstract state
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
3 *
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
4 * Copyright (c) 2020 David Demelier <markand@malikania.fr>
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
5 *
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
6 * Permission to use, copy, modify, and/or distribute this software for any
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
7 * purpose with or without fee is hereby granted, provided that the above
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
8 * copyright notice and this permission notice appear in all copies.
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
9 *
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
17 */
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
18
243
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 164
diff changeset
19 #ifndef MOLKO_CORE_STATE_H
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 164
diff changeset
20 #define MOLKO_CORE_STATE_H
44
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
21
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
22 union event;
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
23
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
24 struct state {
162
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
25 void *data;
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
26 void (*start)(struct state *state);
164
87f8ef73a160 doc: some fixes
David Demelier <markand@malikania.fr>
parents: 162
diff changeset
27 void (*handle)(struct state *state, const union event *ev);
162
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
28 void (*update)(struct state *state, unsigned int ticks);
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
29 void (*draw)(struct state *state);
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
30 void (*end)(struct state *state);
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
31 void (*finish)(struct state *state);
44
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
32 };
c97fe725fdeb core: implement basic states, closes #2457 @1h
David Demelier <markand@malikania.fr>
parents:
diff changeset
33
162
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
34 void
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
35 state_start(struct state *state);
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
36
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
37 void
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
38 state_handle(struct state *state, const union event *ev);
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
39
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
40 void
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
41 state_update(struct state *state, unsigned int ticks);
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
42
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
43 void
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
44 state_draw(struct state *state);
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
45
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
46 void
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
47 state_end(struct state *state);
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
48
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
49 void
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
50 state_finish(struct state *state);
629f55f3961e core: rework states
David Demelier <markand@malikania.fr>
parents: 147
diff changeset
51
243
71b3b7036de7 misc: lot of cleanups,
David Demelier <markand@malikania.fr>
parents: 164
diff changeset
52 #endif /* !MOLKO_CORE_STATE_H */