comparison libcore/core/game.h @ 147:b386d25832c8

doc: use new nomenclature, closes #2497
author David Demelier <markand@malikania.fr>
date Thu, 15 Oct 2020 09:21:04 +0200
parents 789b23e01f52
children eb3148c1e54d
comparison
equal deleted inserted replaced
146:7d7ea7a9cf50 147:b386d25832c8
24 * \brief Main game object. 24 * \brief Main game object.
25 */ 25 */
26 26
27 #include <stdbool.h> 27 #include <stdbool.h>
28 28
29 #include "action.h"
30 #include "inhibit.h" 29 #include "inhibit.h"
31 30
32 /** 31 /**
33 * \brief Max number of actions allowed at the same time. 32 * \brief Max number of actions allowed at the same time.
34 */ 33 */
41 /** 40 /**
42 * \brief Main game object. 41 * \brief Main game object.
43 */ 42 */
44 struct game { 43 struct game {
45 /* Inhibition */ 44 /* Inhibition */
46 enum inhibit inhibit; /*!< (RW) What to disable. */ 45 enum inhibit inhibit; /*!< (+) What to disable. */
47 46
48 /* Game states. */ 47 /* Game states. */
49 struct state *state; /*!< (RO) Current state */ 48 struct state *state; /*!< (-) Current state */
50 struct state *state_next; /*!< (RO) Next state */ 49 struct state *state_next; /*!< (-) Next state */
51
52 /** Array of actions. */
53 struct action actions[GAME_ACTIONS_MAX];
54 }; 50 };
55 51
56 /** 52 /**
57 * Global game object. 53 * Global game object.
58 */ 54 */
92 */ 88 */
93 void 89 void
94 game_draw(void); 90 game_draw(void);
95 91
96 /** 92 /**
97 * Add an action to the game.
98 *
99 * If there are no room for the action, action is discarded. Make sure to not
100 * exceed the limit GAME_ACTIONS_MAX.
101 *
102 * \pre action != NULL
103 * \param action the action to copy
104 * \note The core API **never** add actions by itself.
105 */
106 void
107 game_add_action(const struct action *action);
108
109 /**
110 * Stop the game. 93 * Stop the game.
111 * 94 *
112 * This will effectively stop the current state but the main loop may continue 95 * This will effectively stop the current state but the main loop may continue
113 * until it has completed. 96 * until it has completed.
114 */ 97 */