#ifndef FACTORY_OBJECTS_H
#define FACTORY_OBJECTS_H

#include "common.h"

typedef struct object_info_s
{
    SDL_Rect box_rect;
    SDL_Rect collision_rect;
    point_t  collision_cell_ul; // cell up-left
    point_t  collision_cell_br; // cell bottom-right
    vector_t position;
} object_info_t;

typedef enum object_func_e
{
    OFUNC_GETINFO   = 0,
    OFUNC_COLLISION = 1,
    OFUNC_UPDATE    = 2,
    OFUNC_DRAW      = 3,
    OFUNC_FREE      = 4
} object_func_t;

typedef enum direction_e
{
    DIR_UP    = 0,
    DIR_RIGHT = 1,
    DIR_DOWN  = 2,
    DIR_LEFT  = 3
} direction_t;

typedef enum object_layer_e
{
    OLAY_CLOUDS,
    OLAY_BACK,
    OLAY_TILES,
    OLAY_TELEPORT,
    OLAY_BONUSES,
    OLAY_ENEMYES,
    OLAY_HOOK,
    OLAY_ROBO,
    OLAY_SMOKE,
    OLAY_SPAWN,
    OLAY_BULLETS,
    OLAY_EFFECTS,
    OLAY_INTERFACE
} object_layer_t;

typedef struct object_s object_t;

#include "actors.h"

extern bool      FactoryObjects_IsGuardActor(object_t *object, actor_type_t type); //проверки на NULL'ы
extern int       FactoryObjects_GetCount(void);
extern object_t* FactoryObjects_Create(void);
extern void      FactoryObjects_SetActor(object_t *object, void *actor, actor_type_t type, object_layer_t layer);
extern void      FactoryObjects_SetFunc(object_t *object, void *func, object_func_t type_func);
extern void      FactoryObjects_SignRemove(object_t *object);
extern void      FactoryObjects_NeedSort(void);
extern void      FactoryObjects_Update(float dt);
extern void      FactoryObjects_Draw(SDL_Renderer *renderer);
extern void      FactoryObjects_Clear(void);

#endif
