#pragma once #include "raycaster.hpp" #include "constants.hpp" #include "stats.hpp" #include "levelmanager.hpp" #include "camera.hpp" #include "fsm.hpp" #include "render.hpp" #include "map_view.hpp" #include // for hflow, paragraph, separator, hbox, vbox, filler, operator|, border, Element namespace gui { class StatusUI : public Panel { public: GameLevel $level; StatusUI(GameLevel level) : Panel(43, 200, 29, 25, false), $level(level) { default_bg = sf::Color{30,30,30}; } void create_render(); void update_level(GameLevel &level) { $level = level; } }; class CombatUI : public Panel { public: GameLevel $level; Component $attack1_button; Component $attack2_button; CombatUI(GameLevel level) : Panel(RAY_VIEW_X, RAY_VIEW_HEIGHT, 89, 6, false), $level(level) { default_bg = sf::Color{30,30,30}; } void create_render(); void update_level(GameLevel &level) { $level = level; } }; enum class State { START, MOVING, ATTACKING, MAPPING, ROTATING, IDLE, END }; enum class Event { STARTED, TICK, MOVE_FORWARD, MOVE_BACK, MOVE_LEFT, MOVE_RIGHT, MAP_OPEN, CLOSE, ROTATE_LEFT, ROTATE_RIGHT, ATTACK, QUIT }; class FSM : public DeadSimpleFSM { public: // ZED: these two will go away soon int $rotation_count = 0; float $rotation = -10.0f; Point $player{0,0}; LevelManager $levels; sf::RenderWindow $window; SFMLRender $renderer; GameLevel $level; MapViewUI $map_view; CombatUI $combat_view; StatusUI $status_view; CameraLOL $camera; sf::Font $font; sf::Text $text; Stats $stats; TexturePack $textures; Raycaster $rayview; FSM(); void event(Event ev); void START(Event ); void MOVING(Event ); void ATTACKING(Event ); void MAPPING(Event); void ROTATING(Event ); void IDLE(Event ev); void END(Event ev); void try_move(int dir, bool strafe); void keyboard(); void draw_weapon(); void draw_stats(); void draw_gui(); void render(); void mouse(); void generate_map(); bool active(); void run_systems(); }; }