#ifndef PIXELDEFENSE_TILESET_H
#define PIXELDEFENSE_TILESET_H

#include <raylib.h>
#include <cute_tiled.h>

#include "../common.h"

typedef struct TilesetDesc {
    cute_tiled_tileset_t *source;
    const char *assetDir;
} TilesetDesc;

typedef struct Tileset {
    Texture2D tiles;
    int startID;
    int tileWidth;
    int tileHeight;
    int width;
    int height;
    int offsetX;
    int offsetY;
    bool isValid;
} Tileset;

extern Tileset TILESET_INVALID;

Tileset tilesetCreate(const TilesetDesc *desc);

Rectangle tilesetGetTileRegion(Tileset *tileset, int tileID);

void tilesetDestroy(Tileset *tileset);



#endif //PIXELDEFENSE_TILESET_H
