cs381/as6/GameContext.hpp

51 lines
1.3 KiB
C++

#pragma once
#include <memory>
#include <vector>
struct Entity;
/**
* Shared execution context that flows through every entity and component so
* they can read/write the global scroll, known entity handles, and reset state.
*/
struct GameContext {
/**
* Pointer to the global entity list stored in `main.cpp`, allowing systems
* or components to inspect/create entities.
*/
std::vector<std::shared_ptr<Entity>> *entities = nullptr;
/**
* Entity that owns the static world geometry (terrain, background, etc.).
*/
Entity *worldEntity = nullptr;
/**
* Entity representing the gravity well that drags collectibles/probe.
*/
Entity *wellEntity = nullptr;
/**
* Entity for the player's probe input/state representation.
*/
Entity *probeEntity = nullptr;
/**
* HUD entity that draws meter/score/probe status overlays.
*/
Entity *hudEntity = nullptr;
/**
* Global horizontal scroll offset that components read to position
* themselves on screen.
*/
float scrollX = 0.0f;
/**
* Flag that a component (usually reset button) can toggle to request the
* gameplay systems reset the probe/meter/collectibles.
*/
bool resetRequested = false;
};