#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_ttf.h"
#include "SDL/SDL_mixer.h"

#include "../functions/surfaces.hpp"
#include "../functions/collision.hpp"

#include <sstream>

#ifndef ENEMY_HPP_
#define ENEMY_HPP_

const int EnemyNumber = 24;

const int NoEnemy = -1;
const int EasyEnemy = 0;
const int NormalEnemy = 1;
const int HardEnemy = 2;
const int Easy2Enemy = 3;
const int Normal2Enemy = 4;
const int Hard2Enemy = 5;

const int EasyVelocity = 3;
const int NormalVelocity = 2;
const int HardVelocity = 1;
const int Easy2Velocity = 3;
const int Normal2Velocity = 2;
const int Hard2Velocity = 1;

const int UP = 0;
const int DOWN = 1;
const int RIGHT = 2;
const int LEFT = 3;

const int WIDTH = 86;
const int HEIGHT = 61;

typedef struct{
	SDL_Rect Coord;
	SDL_Rect Coord2;
	SDL_Rect Hitbox;
	int type;
	int status;
	int HP;
	bool dead;

	int birthcounter;

}data;

class enemy{

	private:

		Mix_Chunk* TriggerSound;
		Mix_Chunk* MDamageSound;
		Mix_Chunk* MDieSound;
		Mix_Chunk* RDamageSound;

		SDL_Surface* EnemySheet1;
		SDL_Surface* EnemySheet2;
		SDL_Surface* EnemySheet3;
		SDL_Surface* EnemySheet4;
		SDL_Surface* EnemySheet5;
		SDL_Surface* EnemySheet6;
		SDL_Surface* DamageSheet;
		SDL_Surface* MDamageSheet;
		SDL_Surface* BirthSheet;


		SDL_Rect Triggers[ EnemyNumber ];
		bool TriggerOn[ EnemyNumber ];
		data EnemyData[ EnemyNumber ][ 10 ];

		SDL_Rect Offsets[ 4 ][ 4 ];
		SDL_Rect DOffsets[ 4 ];
		int Frame;
		int DFrame;

		bool Damaged;
		int DamageCounter;

		bool Triggered;


	public:

		enemy();
		~enemy();

		void move( int, int, bool, int&, bool, bool Difficulty );
		void show( SDL_Surface* &, bool, bool );

		void fill_enemy();

		bool isTriggered();

};

#endif /* ENEMY_HPP_ */
