76 lines
1.7 KiB
C++
76 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include "../../entity.hpp"
|
|
|
|
#include "area_manager.hpp"
|
|
#include "text.hpp"
|
|
|
|
#include <optional>
|
|
|
|
namespace game::state::play
|
|
{
|
|
class ItemManager
|
|
{
|
|
public:
|
|
static constexpr auto LIMIT = 100;
|
|
|
|
bool isDisabled{};
|
|
bool isAutomation{};
|
|
std::vector<Entity> items{};
|
|
int heldItemIndex{-1};
|
|
int queuedRemoveItemIndex{-1};
|
|
int pendingEatItemIndex{-1};
|
|
int pendingEatEventID{-1};
|
|
int pendingEatAnimationIndex{-1};
|
|
glm::vec4 pendingEatRect{};
|
|
bool isPendingEatRect{};
|
|
bool isEatTextPending{};
|
|
bool isEatTextOverCapacity{};
|
|
|
|
bool isItemHovered{};
|
|
bool isItemHoveredPrevious{};
|
|
bool isJustItemHoveredStopped{};
|
|
|
|
bool isItemHeld{};
|
|
bool isItemHeldPrevious{};
|
|
bool isJustItemHeldStopped{};
|
|
bool isJustItemHeld{};
|
|
bool isJustItemThrown{};
|
|
|
|
bool isItemFinished{};
|
|
|
|
glm::vec2 cursorPositionPrevious{};
|
|
glm::vec2 cursorDeltaPrevious{};
|
|
|
|
std::vector<int> queuedItemIDs{};
|
|
std::vector<bool> discoveredItemIDs{};
|
|
int spawnDelayTicks{};
|
|
struct Particle
|
|
{
|
|
std::string label{};
|
|
glm::vec2 position{};
|
|
};
|
|
|
|
struct Input
|
|
{
|
|
bool isImguiCaptureMouse{};
|
|
bool isMouseLeftClicked{};
|
|
bool isMouseLeftDown{};
|
|
bool isMouseLeftReleased{};
|
|
bool isMouseRightClicked{};
|
|
bool isAutomation{};
|
|
int targetItemIndex{-1};
|
|
};
|
|
|
|
std::optional<Input> inputOverride{};
|
|
std::vector<Particle> particles{};
|
|
|
|
int spawn_delay_get(Entity&);
|
|
bool spawn_possible_get(Entity&);
|
|
bool spawn_available_get(Entity&);
|
|
bool spawn_queue(Entity&, int itemID, bool isLimitIgnored = false);
|
|
bool spawn_queue(Entity&);
|
|
void update(Entity&, Entity&, AreaManager&, Text&, const glm::vec4& bounds, Canvas&);
|
|
};
|
|
}
|