51 lines
1020 B
C
51 lines
1020 B
C
#ifndef PIXELDEFENSE_GAME_STATE_H
|
|
#define PIXELDEFENSE_GAME_STATE_H
|
|
|
|
#include <breeze.h>
|
|
#include <flecs.h>
|
|
|
|
typedef enum InputState {
|
|
INPUT_NONE,
|
|
INPUT_PLACING,
|
|
INPUT_DRAGGING,
|
|
INPUT_SELECTED_UNITS,
|
|
INPUT_SELECTED_OBJECT,
|
|
} InputState;
|
|
|
|
typedef struct Game {
|
|
Camera2D camera;
|
|
BzTileset terrainTileset;
|
|
BzTileset buildingsTileset;
|
|
BzTileset entitiesTileset;
|
|
BzTileMap map;
|
|
BzSpatialGrid *entityGrid;
|
|
f32 frameDuration;
|
|
ecs_entity_t entity;
|
|
struct {
|
|
InputState state;
|
|
int building;
|
|
bool buildingCanPlace;
|
|
TilePosition buildingPos;
|
|
TileSize buildingSize;
|
|
Vector2 mouseDown;
|
|
f32 mouseDownElapsed;
|
|
} input;
|
|
struct {
|
|
i64 wood;
|
|
i64 iron;
|
|
i64 food;
|
|
i64 gold;
|
|
i64 pop;
|
|
} resources;
|
|
struct {
|
|
BzObjectPool *pathData;
|
|
} pools;
|
|
f32 elapsed;
|
|
} Game;
|
|
|
|
extern ecs_world_t *ECS;
|
|
|
|
extern ECS_COMPONENT_DECLARE(Game);
|
|
|
|
#endif //PIXELDEFENSE_GAME_STATE_H
|