Exploring raycasters and possibly make a little "doom like" game based on it.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
raycaster/gui/dnd_loot.hpp

39 lines
963 B

#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();
};
}