#ifndef GAMEDEFENDER3D
#define GAMEDEFENDER3D

/*
	The gamestub.* files are meant to be a possible starting point for your games.  Alter the
	gamestub.* files freely.  
	In the code below, we put the word virtual in front of all the methods that we have
	inherited from the base classes and which we plan to overload.  (These methods were
	already declared as virtual in the base classes, so that our overloads can take effect.
	Declaring them virtual in this child class only means that they could be further overloaded 
	in the children of the child.)
*/

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

//=== cGameDefender3D Critters ====================================

class cCritterDefender3DPlayer : public cCritterArmedPlayer //Our player.
{
DECLARE_SERIAL(cCritterDefender3DPlayer);
public:
	cCritterDefender3DPlayer(cGame *pownergame = NULL);
//overloads
	virtual void reset();
	virtual int damage(int hitstrength);
	virtual BOOL collide(cCritter *pcritter); 
	virtual void update(CPopView *pactiveview, Real dt);
	virtual void draw(cGraphics *pgraphics, int drawflags);
	virtual cCritterBullet* shoot();
};

class cCritterDefender3DPlayerBullet : public cCritterBullet
{
DECLARE_SERIAL(cCritterDefender3DPlayerBullet);
public:
	cCritterDefender3DPlayerBullet();
};

class cCritterDefender3DRival : public cCritterArmedRobot //Or just a cCritter if not shooting
{
DECLARE_SERIAL(cCritterDefender3DRival);
public:
	cCritterDefender3DRival(cGame *pownergame = NULL); /* The defualt arg
		means this defines a no-arg constructor as well.*/
//overloads
	virtual int damage(int hitstrength);
	virtual BOOL collide(cCritter *pcritter); 
	virtual void update(CPopView *pactiveview, Real dt);
};

	/* The cCritterBulletSilver only can damage the ptarget of the
	shooter.   */
class cCritterDefender3DRivalBullet : public cCritterBulletSilver
{
DECLARE_SERIAL(cCritterDefender3DRivalBullet);
public:
	cCritterDefender3DRivalBullet();
	virtual void initialize(cCritterArmed *pshooter);
};

class cCritterDefender3DProp : public cCritter
{
DECLARE_SERIAL(cCritterDefender3DProp);
public:
	static Real EXPLOSIONDISPLAYTIME;
	static int FRAGCOUNT;
	cCritterDefender3DProp(cGame *pownergame = NULL); 
//overloads
	virtual int damage(int hitstrength);
	virtual BOOL collide(cCritter *pcritter); 
	virtual void update(CPopView *pactiveview, Real dt);
	virtual void die(); //Overload to show fragments or explosion bitmap.
};

class cCritterDefender3DPropFrag : public cCritter
{
DECLARE_SERIAL(cCritterDefender3DPropFrag);
public:
	static Real FIXEDLIFETIME;
	cCritterDefender3DPropFrag(cCritter *ppropcritter = NULL); /* Note that this
		constructor takes a prop critter pointer as argument INSTEAD of a game pointer! */
//overloads
	virtual void update(CPopView *pactiveview, Real dt);
	virtual int collidesWith(cCritter *pcritterother);
};

//======================= cGameDefender3D ================


class cGameDefender3D : public cGame
{
DECLARE_SERIAL(cGameDefender3D);
//Name your statics here
static int PLAYERHEALTH;
static int DEFAULTRIVALCOUNT;
static int DEFAULTSEEDCOUNT;
private:
	int _rivalcount; //possible params, don't have to use these.
public:
	cGameDefender3D();
 //overloads
	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); //To change the default view direction.
	virtual void seedCritters();
};

#endif //GAMEDEFENDER3D