#ifndef SPACESHIP_H
#define SPACESHIP_H
#include "main.h"
#include "planet.h"
#include <vector>

#define NUMKEYS 5
#define NUMSHIPS 2

using namespace std;

class bullet;


class spaceship {
	public:
		float x;
		float y;
		int health;
		float angle;
		float speedx;
		float speedy;
		float acceleration;
		float rotFreq;
		int score;
		bool gravity;
		static const float mass = 100;
		GLuint texture;
		GLuint ticks;
		GLuint ticks1;
		GLuint ticks2;
		int thrustchannel1;
		int thrustchannel2;
		int shootchannel;
		int hitchannel;
		vector<bullet> bullets;
		SDLKey keys[NUMKEYS];
		static const float width = 40;
		static const float height = 40;
		bool AIenabled;
		spaceship();
		~spaceship();
		SDLKey getUpKey();
		SDLKey getDownKey();
		SDLKey getLeftKey();
		SDLKey getRightKey();
		SDLKey getShootKey();
		void move(vector<planet*> &planetlist, vector <spaceship> &spaceshiplist, screen *scr);
		void draw(GLuint texture);
		int setRotFreq(float rotFreq);
		float getRotFreq();
		int setAcceleration(float acceleration);
		float getAcceleration();
		void shoot();
		void setTextures (GLuint gravshiptex, GLuint antigravshiptex, GLuint gravbullettex, GLuint antigravbullettex);
		void setkeys (SDLKey up, SDLKey down, SDLKey left, SDLKey right, SDLKey shoot);
		void setgravity(bool grav);
		void die(screen *scr, spaceship &other);
		float getX();
		float getY();
};
#endif /* SPACESHIP_H */

