#ifndef LEVEL_H
#define LEVEL_H

#include "common.h"
#include "factory_objects.h"

#define CELL_FRAME_WIDTH  16
#define CELL_FRAME_HEIGHT 16
#define CELL_WIDTH  48
#define CELL_HEIGHT 48

#define ID_CELL_COIN               55
#define ID_CELL_DIAMOND            56
#define ID_CELL_CHECKPOINT         61
#define ID_CELL_COLLISION_BLOCK    62
#define ID_CELL_COLLISION_BRIDGE   63
#define ID_CELL_COLLISION_CRASH    64
#define ID_CELL_TURN_RIGHT         65
#define ID_CELL_TURN_LEFT          66
#define ID_CELL_ROBO_START         67
#define ID_CELL_ROBO_FINISH        68
#define ID_CELL_WALLFIRER_R        69
#define ID_CELL_WALLFIRER_D        70
#define ID_CELL_WALLFIRER_L        71
#define ID_CELL_WALLFIRER_U        72
#define ID_CELL_SPIKES             73
#define ID_CELL_HAMMER             74
#define ID_CELL_ENEMY_WALKER       75
#define ID_CELL_ENEMY_CIRCULARSAW  76
#define ID_CELL_ENEMY_TANK         77
#define ID_CELL_GEAR               78

extern void     Level_CreateEmpty(const int cells_width, const int cells_height);
extern void     Level_Create(const char *filename);
extern void     Level_Destroy(void);
extern int      Level_GetCellsWidth(void);
extern int      Level_GetCellsHeight(void);
extern int      Level_GetWidth(void);
extern int      Level_GetHeight(void);
extern vector_t Level_GetPositionStart(void);
extern void     Level_OpenFogInPosition(vector_t position);
extern bool     Level_CheckCollision(object_info_t info, vector_t velocity, bool horizonatal, float *correct_value);
extern bool     Level_CheckTurn(object_info_t info, bool *right);
extern void     Level_DrawCollisions(SDL_Renderer *renderer);
extern void     Level_DrawObjects(SDL_Renderer *renderer);
extern void     Level_DrawTiles(SDL_Renderer *renderer);
extern void     Level_DrawBack(SDL_Renderer *renderer);
extern void     Level_DrawFog(SDL_Renderer *renderer);

#endif
