	//unit.h
#ifndef UNIT_H
#define UNIT_H
//#include "View.h"
//#include "Stats.h"
#include "Layer.h"


//#include "AstarPathfinder.h"
//typs of units
///inviseal walls for coller,npcs, players, triggers, spond points,particals sponds, hot spots :tellport room enters,area exits
#include "music.h"
class View;
class Statss;
enum gender { male, female, none};

//enum orienation { upd, downd, leftd, rightd};
class Unit
{
	protected:
	//data members
		//THE SEVERWILL SET IDS AND GIVE OUT IDS THE FIRST BIT IN ID WILL TELL IN NPC OR PLAYER UINT
		int id;
		int socketid;
		int x;
		int y;
		int w;
		int h;
		int layer;
		int source_X;
		int source_Y;
		int collision;
		int frame;
		int direction;
		int source;
		int inarea;
		string name;
		int dest;


	public:
		int commanded;
		bool trading;
		bool selected;
bool secon;
int damagetaken;
int predamagetaken;
		int frspeed ;///glitch with animate when set to 1
		int connte ;
		int scriptId;
		int type; // this is so you know what the object is
				int target;
		int owner_id; // letter we will do a bool is_freind(unit);
		int spunits;
		int spunits_max;
ISpVoice* Voice ;
int state;



	int controlltype;
Statss *attributess ;
		//gets

		string Get_name();
		int Get_inarea();
		int Get_id();
		int Get_owner_id();
		int Get_socketid();
		int Get_X();
		int Get_Y();
		int Get_W();
		int Get_H();
		int Get_frame();
		int Get_layer();
		int Get_source_X();
		int Get_source_Y();
		int Is_in_collision();
		int Get_direction();
		int Get_sourcebitmap();
		int Get_destbitmap();
		//sets
		void Set_name(string );
		void Set_inarea(int);
		void Set_id(int);

		void Set_owner_id(int);
		void Set_socketid(int);
		void Set_X(int);
		void Set_Y(int);
		void Set_H(int);
		void Set_W(int);
		void Set_frame(int);
		void Set_layer(int);
		void Set_source_X(int);
		void Set_source_Y(int);
		void Set_collision(int);
		void Set_direction(int);
		void Set_sourcebitmap(int);
		void Set_destbitmap(int);
		void draw(BITMAP*,View,DATAFILE *);
		void showname(BITMAP* ,View );
		virtual void Set_destx(int){};
		virtual void Set_desty(int){};
		virtual int Get_destx(){return 0;};
		virtual int Get_desty(){return 0;};
		virtual string toString(void){return string();};
		 Statss *get_attributess(void){return attributess;} ;
		virtual	void animate(void){};
		virtual	void talk(BITMAP* ,View ){};
		
		virtual	void showlife(BITMAP* ,View ,DATAFILE *){};
		virtual void Set_dieolog(string){};
bool hit_wall(int,Layer*,View);
virtual	void do_moveing(Layer* ,View ){};
		virtual void set_mesageLife(int){};
		virtual void fromString(void){};
		virtual void Set_unit(string ){};
		virtual	int attack(Unit*){return 0;};
		virtual	int get_type(void){return type;};
		virtual	void Set_scriptId(int){};
virtual	int Get_scriptId(){return -1;};
		virtual void Set_race(string ){};
		virtual void Set_sex(gender){};
		virtual void runStatScript(){};
bool triggered;
void play_sound(int s,DATAFILE *);
void play_song(int s,DATAFILE *);
void draw_select(BITMAP*,View,int&);
//AstarPathfinder *Astar;



void stop_song();

 //void set_onewhotiggeredme(Unit*){}
//virtual Unit* get_onewhotiggeredme(){return &Unit();}
		bool is_collision( Unit* );
		bool targetinsite( Unit* );
		bool targetinrange( Unit* );
		virtual string Get_unit(void){return string();};
		//constutors
		Unit();
		~Unit();
		Unit(int,BITMAP*);
		//other founctions
		//void drawer( BITMAP *bmpp ,BITMAP *bmp ,int x,int y,int w, int h , int frame_x, int frame_y );
		//void masked_blit(BITMAP *source, BITMAP *dest, int source_x, int source_y, int dest_x, int dest_y, int width, int height);

};



/////////////////////////////////////////////////////


	

#endif
