Buildings as entities instead of map layer

This commit is contained in:
2024-01-08 14:41:26 +01:00
parent 03dc3774e7
commit c08fca9670
17 changed files with 168 additions and 186 deletions

View File

@@ -4,10 +4,13 @@
#include <breeze.h>
#include <flecs.h>
#include "components.h"
#include "game_tileset.h"
bool canPlaceBuilding(BzTileMap *map, BuildingType type, i32 tileX, i32 tileY);
ecs_entity_t placeBuilding(BzTileMap *map, BuildingType type, i32 tileX, i32 tileY);
typedef struct Game Game;
bool canPlaceBuilding(Game *game, BuildingType type, i32 tileX, i32 tileY);
ecs_entity_t placeBuilding(Game *game, BuildingType type, i32 tileX, i32 tileY, Owner owner);
Vector2 getPositionNearBuilding(ecs_entity_t building, Vector2 fromPos);