#ifndef GAMESPACEWAR
#define GAMESPACEWAR

#include "game.h"
#include "critterarmed.h"

//=== cGameSpacewar Helpers: cCritterArmedPlayerSpacewar, CritterAsteroid, cCritterUFO, CritterUFOSmart ===

class cCritterArmedPlayerSpacewar : public cCritterArmedPlayer //Our player.
{
DECLARE_SERIAL(cCritterArmedPlayerSpacewar);
public:
	cCritterArmedPlayerSpacewar(cGame *pownergame = NULL);
	void reset();
};

class cCritterAsteroid : public cCritter
{
DECLARE_SERIAL(cCritterAsteroid);
public:
	static int VALUE;
	static int HEALTH;
	static Real CHASEACCELERATION; //Rate you accelerate towards ptarget.
	static Real DARTACCELERATION; //Rate you accelerate away from an enemy bullet.
	static Real DARTSPEEDUP; //When fleeing a bullet your maxspeed is multiplied by this.
	static int OVERPOPULATIONCOUNT; /* If there's more cCritterAsteroid than this
		we don't let them split in two. */
public:
	cCritterAsteroid(cGame *pownergame = NULL); /*I don't really need a default argument for the
		constructor in my code, but any DECLARE_SERIAL class requires a default constructor.  By
		giving pplayer a default NULL value, this acts also as a default no-argument constructor.*/
//overloads
	virtual int damage(int hitstrength);
};

class cCritterUFO : public cCritterArmedRobot
{
DECLARE_SERIAL(cCritterUFO);
public:
	static int VALUE;
	static int HEALTH;
	static Real CHASEACCELERATION; //Rate you accelerate towards ptarget.
	static Real DARTACCELERATIONBULLET; //Rate you accelerate away from an enemy bullet.
	static Real DARTSPEEDUPBULLET; //When fleeing a bullet your maxspeed is multiplied by this.
	static Real DARTACCELERATIONCRITTER; //Rate you accelerate away from other critters.
	static Real DARTSPEEDUPCRITTER; //When fleeing a critter your maxspeed is multiplied by this.
	static Real WAITSHOOT;
public:
	cCritterUFO(cGame *pownergame = NULL);
//overloads
	virtual int damage(int hitstrength);
	virtual void update(CPopView *pview, Real dt); //overload to keep turning wrap flag off.
};

class cCritterUFOSmart : public cCritterUFO
{
DECLARE_SERIAL(cCritterUFOSmart);
public:
	static int HEALTH;
public:
	cCritterUFOSmart(cGame *pownergame = NULL);
};


//======================= cGameSpacewar ================


class cGameSpacewar : public cGame
{
DECLARE_SERIAL(cGameSpacewar);
public:
	//See comments where these statics are implemented in gamespacewar.cpp
	static Real WORLDSIZE;
	static Real CRITTERMINRADIUS;
	static Real CRITTERMAXRADIUS;
	static Real CRITTERMAXSPEED; //Starting max speed
	static Real CRITTERMAXSPEEDLIMIT; //Absolute maximum speed
	static Real SPEEDMULTIPLIER; 
	static Real ENEMYBULLETSPEED;
	static Real BULLETRADIUS;
	static Real ENEMYWAITSHOOT;
	static int PLAYERHEALTH;
	static int ENEMYBULLETVALUE;
	static int ENEMYMISSILEVALUE;
	static int SCORELEVEL;
	static int LEVELREWARD;
	static int UFOATTACKSCORE;
	static Real SMARTUFOPROBABILITY;
	int _lastinvasionscore; 
public:
	cGameSpacewar();
 	virtual void Serialize(CArchive& ar); //Overload for _lastinvasionscore
	virtual void reset();
	virtual void adjustGameParameters();
	virtual CString statusMessage();
	virtual void initializeView(CPopView *pview);
	virtual void initializeViewpoint(cCritterViewer *pviewer);
	virtual void seedCritters();
 	virtual void setAutoplay(int autoplay); /* Overload so as to make sure the
		player is using cListenerSpaceship. */
};

#endif //GAMESPACEWAR