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
39
gui/dnd_loot.hpp
Normal file
39
gui/dnd_loot.hpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
#include "simplefsm.hpp"
|
||||
#include <guecs/ui.hpp>
|
||||
#include "gui/status_ui.hpp"
|
||||
#include "gui/loot_ui.hpp"
|
||||
#include "gui/event_router.hpp"
|
||||
|
||||
namespace gui {
|
||||
enum class DNDState {
|
||||
START=0,
|
||||
LOOTING=1,
|
||||
LOOT_GRAB=2,
|
||||
INV_GRAB=3,
|
||||
END=4
|
||||
};
|
||||
|
||||
class DNDLoot : public DeadSimpleFSM<DNDState, Event> {
|
||||
public:
|
||||
std::optional<guecs::Entity> $grab_source = std::nullopt;
|
||||
StatusUI& $status_ui;
|
||||
LootUI& $loot_ui;
|
||||
sf::RenderWindow& $window;
|
||||
routing::Router& $router;
|
||||
|
||||
DNDLoot(StatusUI status_ui,
|
||||
LootUI loot_ui, sf::RenderWindow& window,
|
||||
routing::Router& router);
|
||||
|
||||
bool event(Event ev, std::any data={});
|
||||
|
||||
void START(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 mouse_action(bool hover);
|
||||
sf::Vector2f mouse_position();
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue