Logging for the FSM works better now.
This commit is contained in:
parent
0aeb5b4ceb
commit
40ba7f0b66
3 changed files with 3 additions and 4 deletions
3
fsm.hpp
3
fsm.hpp
|
@ -5,7 +5,7 @@
|
|||
#ifndef FSM_DEBUG
|
||||
#define FSM_STATE(C, S, F, E) case C::S: F(E); break
|
||||
#else
|
||||
#define FSM_STATE_LOG(C, S, F, E) case C::S: fmt::println(">> " #C " " #S ":" #F " event={}, state={}", int(E), int(_state)); F(E); fmt::println("<< " #C " state={}", int(_state)); break
|
||||
#define FSM_STATE(C, S, F, E) case C::S: fmt::println(">> " #C " " #S ":" #F " event={}, state={}", int(E), int(_state)); F(E); fmt::println("<< " #C " state={}", int(_state)); break
|
||||
#endif
|
||||
|
||||
template<typename S, typename E>
|
||||
|
@ -18,7 +18,6 @@ public:
|
|||
virtual void event(E event) = 0;
|
||||
|
||||
void state(S next_state) {
|
||||
// fmt::println("STATE {}->{}", int(_state), int(next_state));
|
||||
_state = next_state;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
#include "game_engine.hpp"
|
||||
#include <cassert>
|
||||
|
||||
#define FSM_DEBUG 1
|
||||
|
||||
const auto ERROR = fmt::emphasis::bold | fg(fmt::color::red);
|
||||
|
||||
using namespace fmt;
|
||||
|
|
|
@ -3,10 +3,12 @@
|
|||
BUGS:
|
||||
* BUG: Log doesn't scroll.
|
||||
* BUG: lots of errors crash it
|
||||
* BUG: doesn't play you_died sound.
|
||||
|
||||
TODO:
|
||||
* Rewrite dbc.hpp to actually work.
|
||||
* Use parameter pack in FSM template
|
||||
* Add a timer to the game engine so you can set a kind of pomodoro timer and if you don't meet the goal it costs you.
|
||||
* Track the deaths.
|
||||
|
||||
https://en.cppreference.com/w/cpp/language/parameter_pack
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue