#ifndef PIXELDEFENSE_COMPONENTS_H #define PIXELDEFENSE_COMPONENTS_H #include #include #include "utils/building_types.h" extern ECS_TAG_DECLARE(TextureTerrain); extern ECS_TAG_DECLARE(TextureBuildings); extern ECS_TAG_DECLARE(TextureEntities); typedef struct TilePosition { BzTile x; BzTile y; } TilePosition; extern ECS_COMPONENT_DECLARE(TilePosition); typedef struct TileSize { BzTile sizeX; BzTile sizeY; } TileSize; extern ECS_COMPONENT_DECLARE(TileSize); typedef struct Owner { BuildingType playerID; } Owner; extern ECS_COMPONENT_DECLARE(Owner); typedef Vector2 Position, Size, TargetPosition, MoveForce; extern ECS_COMPONENT_DECLARE(Position); extern ECS_COMPONENT_DECLARE(Size); extern ECS_COMPONENT_DECLARE(TargetPosition); extern ECS_COMPONENT_DECLARE(MoveForce); typedef enum ResourceType { RES_IRON, RES_WOOD, RES_GOLD, RES_FOOD, RES_COUNT, } ResourceType; typedef struct Resource { ResourceType type; i32 amount; } Resource; extern ECS_COMPONENT_DECLARE(Resource); typedef BzSpatialGridID SpatialGridID; extern ECS_COMPONENT_DECLARE(SpatialGridID); typedef f32 Rotation; extern ECS_COMPONENT_DECLARE(Rotation); typedef f32 Health; extern ECS_COMPONENT_DECLARE(Health); typedef struct TextureRegion { Texture2D texture; Rectangle rec; bool flipX; bool flipY; } TextureRegion; extern ECS_COMPONENT_DECLARE(TextureRegion); typedef enum AnimationType { ANIMATION_IDLE, ANIMATION_WALK, } AnimationType; extern ECS_COMPONENT_DECLARE(AnimationType); typedef struct Animation { TextureRegion firstFrame; AnimationType currAnimation; i32 currFrame; i32 frameCount; f32 frameDuration; f32 elapsed; } Animation; extern ECS_COMPONENT_DECLARE(Animation); #define PATH_DATA_SIZE 8 typedef struct PathData { Position waypoints[PATH_DATA_SIZE]; size_t numWaypoints; struct PathData *next; } PathData; typedef struct Path { PathData *paths; i32 curWaypoint; } Path; extern ECS_COMPONENT_DECLARE(Path); void initComponentIDs(ecs_world_t *ecs); #endif //PIXELDEFENSE_COMPONENTS_H