comparison libmlk-core/core/game.c @ 260:60a214ec1ab4

adventure: change the way states are stored
author David Demelier <markand@malikania.fr>
date Sun, 06 Dec 2020 22:50:48 +0100
parents 37771eaf4245
children bfde372bf152
comparison
equal deleted inserted replaced
259:16be1ad3ddba 260:60a214ec1ab4
47 } 47 }
48 48
49 state_start(game.state = state); 49 state_start(game.state = state);
50 } else 50 } else
51 game.state_next = state; 51 game.state_next = state;
52 }
53
54 struct state *
55 game_replace(struct state *state)
56 {
57 assert(state);
58
59 struct state *save = game.state;
60
61 game.state = state;
62
63 state_start(state);
64
65 return save;
52 } 66 }
53 67
54 void 68 void
55 game_handle(const union event *ev) 69 game_handle(const union event *ev)
56 { 70 {