Files are now in a src directory and I'm using a src/meson.build and tests/meson.build to specify what to build.
This commit is contained in:
parent
4778677647
commit
1d4ae911b9
108 changed files with 94 additions and 83 deletions
|
|
@ -1,66 +0,0 @@
|
|||
#pragma once
|
||||
#include "simplefsm.hpp"
|
||||
#include <guecs/ui.hpp>
|
||||
#include "gui/status_ui.hpp"
|
||||
#include "gui/loot_ui.hpp"
|
||||
#include "gui/event_router.hpp"
|
||||
#include "events.hpp"
|
||||
|
||||
namespace gui {
|
||||
enum class DNDState {
|
||||
START=100,
|
||||
LOOTING=101,
|
||||
LOOT_GRAB=102,
|
||||
INV_GRAB=103,
|
||||
ITEM_PICKUP=104,
|
||||
INV_PICKUP=105,
|
||||
END=106
|
||||
};
|
||||
|
||||
class DNDLoot : public DeadSimpleFSM<DNDState, game::Event> {
|
||||
public:
|
||||
std::optional<guecs::Entity> $grab_source = std::nullopt;
|
||||
std::shared_ptr<sf::Sprite> $grab_sprite = nullptr;
|
||||
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(game::Event ev, std::any data={});
|
||||
|
||||
void START(game::Event ev);
|
||||
void LOOTING(game::Event ev, std::any data);
|
||||
void LOOT_GRAB(game::Event ev, std::any data);
|
||||
void INV_GRAB(game::Event ev, std::any data);
|
||||
void END(game::Event ev, std::any data={});
|
||||
void ITEM_PICKUP(game::Event ev, std::any data);
|
||||
void INV_PICKUP(game::Event ev, std::any data);
|
||||
|
||||
void handle_mouse(game::Event ev, guecs::UI& gui);
|
||||
void render();
|
||||
void open();
|
||||
void close();
|
||||
|
||||
std::optional<guecs::Entity> start_grab(guecs::UI& gui, std::any data);
|
||||
|
||||
bool commit_drop(guecs::UI& source, guecs::UI& target,
|
||||
std::optional<guecs::Entity> source_id, std::any data);
|
||||
|
||||
bool commit_move(guecs::UI& gui,
|
||||
std::optional<guecs::Entity> source_id, guecs::Entity drop_id);
|
||||
|
||||
bool hold_item(guecs::UI& gui, guecs::Entity gui_id);
|
||||
void throw_on_floor(guecs::UI& gui, bool from_status);
|
||||
|
||||
void clear_grab();
|
||||
|
||||
bool move_or_swap(StatusUI& status_ui, guecs::Entity drop_id);
|
||||
bool move_or_swap(LootUI& ui, guecs::Entity drop_id);
|
||||
|
||||
sf::Vector2f mouse_position();
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue