Created a separate FSM for the DND functionality that compiles but need to wire it in to work.
This commit is contained in:
parent
1ab708c4eb
commit
82ee8f68f7
7 changed files with 221 additions and 139 deletions
14
gui/fsm.hpp
14
gui/fsm.hpp
|
@ -13,6 +13,7 @@
|
|||
#include "gui/mini_map.hpp"
|
||||
#include "events.hpp"
|
||||
#include "gui/event_router.hpp"
|
||||
#include "gui/dnd_loot.hpp"
|
||||
|
||||
namespace gui {
|
||||
enum class State {
|
||||
|
@ -24,10 +25,8 @@ namespace gui {
|
|||
ROTATING=5,
|
||||
NEXT_LEVEL=6,
|
||||
LOOTING=7,
|
||||
LOOT_GRAB=8,
|
||||
INV_GRAB=9,
|
||||
IDLE=10,
|
||||
END=11
|
||||
IDLE=8,
|
||||
END=9
|
||||
};
|
||||
|
||||
class FSM : public DeadSimpleFSM<State, Event> {
|
||||
|
@ -49,12 +48,11 @@ namespace gui {
|
|||
LootUI $loot_ui;
|
||||
sf::Font $font;
|
||||
gui::routing::Router $router;
|
||||
std::optional<guecs::Entity> $grab_source;
|
||||
DNDLoot $dnd_loot;
|
||||
|
||||
FSM();
|
||||
|
||||
void event(Event ev);
|
||||
void event(Event ev, std::any data);
|
||||
void event(Event ev, std::any data={});
|
||||
void autowalk();
|
||||
void start_autowalk(double rot_speed);
|
||||
|
||||
|
@ -68,8 +66,6 @@ namespace gui {
|
|||
void COMBAT_ROTATE(Event ev);
|
||||
void NEXT_LEVEL(Event ev);
|
||||
void LOOTING(Event ev, std::any data);
|
||||
void LOOT_GRAB(Event ev, std::any data);
|
||||
void INV_GRAB(Event ev, std::any data);
|
||||
void END(Event ev);
|
||||
|
||||
void try_move(int dir, bool strafe);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue