#ifndef ACTORS_H
#define ACTORS_H

#include "common.h"
#include "sprite.h"

// гравитация
#define ACTOR_GRAVITY 0.3f

#define ACTOR_ROBO_VELOCITY_HORIZONTAL 3.0f
#define ACTOR_ROBO_VELOCITY_VERTICAL   3.0f
#define ACTOR_HOOK_MAX_LENGTH          280

#define ACTOR_WALKER_VELOCITY_HORIZONTAL      1.0f
#define ACTOR_CIRCULARSAW_VELOCITY_HORIZONTAL 1.0f
#define ACTOR_TANK_VELOCITY_HORIZONTAL        1.0f


// (кувалда) радиус в пределах которой происходит встряска
#define ACTOR_HAMMER_SHAKE_RADIUS       150

// (кувалда) максимальная длина верёвки
#define ACTOR_HAMMER_MAX_LENGTH         240

// (кувалда) верикальное ускорение - подъём
#define ACTOR_HAMMER_VELOCITY_VERTICAL  1.0f

typedef enum actor_type_e
{
    AT_NONE,
    AT_CLOUD,
    AT_BACK,
    AT_TILES,
    AT_ROBO,
    AT_HOOK,
    AT_TELEPORT,
    AT_SPAWN,
    AT_COIN,
    AT_DIAMOND,
    AT_GEAR,
    AT_CHECKPOINT,
    AT_SPIKES,
    AT_HAMMER,
    AT_WALLFIRER,
    AT_WALKER,
    AT_CIRCULARSAW,
    AT_TANK,
    AT_BULLET,
    AT_FIREBALL,
    AT_SMOKE,
    AT_GROUND_PARTICLE,
    AT_GIBLET_PARTICLE
} actor_type_t;

typedef struct actor_cloud_s           actor_cloud_t;
typedef struct actor_back_s            actor_back_t;
typedef struct actor_tiles_s           actor_tiles_t;
typedef struct actor_robo_s            actor_robo_t;
typedef struct actor_hook_s            actor_hook_t;
typedef struct actor_teleport_s        actor_teleport_t;
typedef struct actor_spawn_s           actor_spawn_t;
typedef struct actor_coin_s            actor_coin_t;
typedef struct actor_diamond_s         actor_diamond_t;
typedef struct actor_gear_s            actor_gear_t;
typedef struct actor_checkpoint_s      actor_checkpoint_t;
typedef struct actor_wallfirer_s       actor_wallfirer_t;
typedef struct actor_spikes_s          actor_spikes_t;
typedef struct actor_hammer_s          actor_hammer_t;
typedef struct actor_walker_s          actor_walker_t;
typedef struct actor_circularsaw_s     actor_circularsaw_t;
typedef struct actor_tank_s            actor_tank_t;
typedef struct actor_bullet_s          actor_bullet_t;
typedef struct actor_fireball_s        actor_fireball_t;
typedef struct actor_smoke_s           actor_smoke_t;
typedef struct actor_ground_particle_s actor_ground_particle_t;
typedef struct actor_giblet_particle_s actor_giblet_particle_t;

extern void          Actor_Cloud_Create(object_t *object, float x, float y);
extern void          Actor_Back_Create(object_t *object, int width, int height);
extern void          Actor_Tiles_Create(object_t *object, int width, int height);
extern actor_robo_t* Actor_Robo_Create(object_t *object, float x, float y);
extern vector_t      Actor_Robo_GetPosition(actor_robo_t *actor);
extern void          Actor_Robo_HideHook(actor_robo_t *actor);
extern void          Actor_Robo_ConnectCheckpoint(actor_robo_t *actor, actor_checkpoint_t *actor_checkpoint);
extern void          Actor_Robo_ControllUp(actor_robo_t *actor);
extern void          Actor_Robo_ControllRight(actor_robo_t *actor);
extern void          Actor_Robo_ControllDown(actor_robo_t *actor);
extern void          Actor_Robo_ControllLeft(actor_robo_t *actor);
extern void          Actor_Robo_ControllSpace(actor_robo_t *actor);
extern void          Actor_Robo_Kill(actor_robo_t *actor);
extern void          Actor_Robo_Hit(actor_robo_t *actor);
extern void          Actor_Robo_Remove(actor_robo_t *actor);
extern bool          Actor_Robo_IsHit(actor_robo_t *actor);
extern actor_hook_t* Actor_Hook_Create(object_t *object, actor_robo_t *actor_robo, float x, float y);
extern bool          Actor_Hook_IsGrab(actor_hook_t *actor);
extern void          Actor_Teleport_Create(object_t *object, float x, float y);
extern void          Actor_Spawn_Create(object_t *object, float x, float y, bool go_nextlevel);
extern void          Actor_Coin_Create(object_t *object, float x, float y);
extern void          Actor_Diamond_Create(object_t *object, float x, float y);
extern void          Actor_Gear_Create(object_t *object, float x, float y);
extern void          Actor_Checkpoint_Create(object_t *object, float x, float y);
extern void          Actor_Checkpoint_LowerFlag(actor_checkpoint_t *actor);
extern vector_t      Actor_Checkpoint_GetPosition(actor_checkpoint_t *actor);
extern void          Actor_Wallfirer_Create(object_t *object, int direction, float x, float y);
extern void          Actor_Spikes_Create(object_t *object, float x, float y);
extern void          Actor_Hammer_Create(object_t *object, float x, float y);
extern void          Actor_Walker_Create(object_t *object, float x, float y);
extern void          Actor_Circularsaw_Create(object_t *object, float x, float y);
extern void          Actor_Tank_Create(object_t *object, float x, float y);
extern void          Actor_Bullet_Create(object_t *object, int direction, float x, float y);
extern void          Actor_Fireball_Create(object_t *object, int direction, float x, float y);
extern void          Actor_Smoke_Create(object_t *object, float x, float y);
extern void          Actor_GroundParticle_Create(object_t *object, float x, float y, int max_life);
extern void          Actor_GibletParticle_Create(object_t *object, float x, float y, int max_life);

#endif
