// // Created by bruno on 4/24/25. // #ifndef FACTORYGAME_PLAYER_H #define FACTORYGAME_PLAYER_H #include "../tiles/tile.h" extern int playerReach; extern int playerX; extern int playerY; #define playerTileX (playerX / TILE_SIZE) #define playerTileY (playerY / TILE_SIZE) extern int playerSpeed; bool isInbounds(int x, int y); bool isInboundsRect(SDL_Rect rect); bool isInboundsTile(int x, int y); void adjustRect(SDL_Rect *rect); typedef struct { uint16_t slotCounts[ITEMREGISTRY_SIZE]; uint16_t activeSlotIndex; } PlayerInventory; typedef struct { int windowX; int windowY; int tileX; int tileY; int tileDiffX; int tileDiffY; int tileDiff; bool canReach; OrientDirection direction; SDL_Rect targetTileRect; Tile *targetTile; Tile *prevTargetTile; int breakingProgress; } PlayerCursor; typedef struct { PlayerCursor cursor; PlayerInventory inventory; SDL_Renderer *renderer; } Player; void setActivePlayerSlot(Player * plr, uint16_t activeSlotIndex); void renderPlayer(Player * plr); void initPlayer(Player * plr); #endif //FACTORYGAME_PLAYER_H