/******************************************************************************/
/* gamestub.ch: interface of the GameStub class and associated classes.       */
/*                                                                            */
/* Based on the built in gamestub.h file supplied with POP.  See the user's   */
/* guide for more detailed information about the game.                        */
/*																			  */
/* Modified by: Brad Tennis, Dave Buchfuhrer, and Jon Dodge					  */
/* 2.16.04                                                                    */
/******************************************************************************/

#ifndef GAMESTUB_H
#define GAMESTUB_H

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

//==============Critters for the cGameStub: Player, Walker, Spiker, Evan, Cannon, =====================================

//============================ cCritterStubPlayer =====================================================================
class cCritterStubPlayer : public cCritterArmedPlayer 
{
DECLARE_SERIAL(cCritterStubPlayer)
public:
	// Constructor
	cCritterStubPlayer(cGame *pownergame = NULL);

	// Used to detect and properly handle collisions.
	BOOL collide(cCritter *pcritter);
	
	// Used to determine if the player has died in a pit and various other tasks that need constant updating.
	void update(CPopView *pactiveview, Real dt);
};

//============================ cCritterWalker =========================================================================
class cCritterWalker : public cCritter
{
DECLARE_SERIAL(cCritterWalker)
public:
	// Constructors
	cCritterWalker(cGame *pownergame = NULL);
	cCritterWalker(cGame *pownergame, cVector location);
	
	// Used to determine if the critter has died in a pit and various other tasks that need constant updating.
	void update(CPopView *pactiveview, Real dt);
	
	// Used to destroy the critter.
	void die();
};

//============================ cCritterSpiker =========================================================================
class cCritterSpiker : public cCritter
{
DECLARE_SERIAL(cCritterSpiker)
public:
	// Constructors
	cCritterSpiker(cGame *pownergame = NULL);
	cCritterSpiker(cGame *pownergame, cVector location);
	
	// Used to determine if the critter has died in a pit and various other tasks that need constant updating.
	void update(CPopView *pactiveview, Real dt);

	// Used to destroy the critter.
	void die();
};

//============================ cCritterEvan ===========================================================================
class cCritterEvan : public cCritterArmedRobot
{
	DECLARE_SERIAL(cCritterEvan)
public:
	// Constructors
	cCritterEvan(cGame *pownergame = NULL);
	cCritterEvan(cGame *pownergame, cVector location);
	
	// Used to determine if the critter has died in a pit and various other tasks that need constant updating.
	void update(CPopView *pactiveview, Real dt);

	// Used to destroy the critter and create an exit portal.
	void die();

	// Used to fire a bullet at the player from Evan.
	cCritterBullet* shoot();
};

//============================ cCritterCannon =========================================================================
class cCritterCannon : public cCritterArmedRobot
{
DECLARE_SERIAL(cCritterCannon)
public:
	// Constructors
	cCritterCannon(cGame *pownergame = NULL);
	cCritterCannon(cGame *pownergame, cVector location);
	
	// Used to determine if the critter has died in a pit and various other tasks that need constant updating.
	void update(CPopView *pactiveview, Real dt); // do a delete_me if you hit the left end
	
	// Used to destroy the critter.
	void die(); //Overload to give score to the player when it jumps on it.
	
	// Used to detect and properly handle collisions.
	virtual BOOL collide(cCritter *pcritter);
	int cCritterCannon::collidesWith(cCritter *pothercritter);
};

//============== Bullets for the cGameStub: CannonBall, MathBall, Puke ================================================

//============================ cCritterCannonBall =====================================================================
class cCritterCannonBall : public cCritterBullet
{
DECLARE_SERIAL(cCritterCannonBall)
public:
	// Constructor
	cCritterCannonBall();

	// Used to determine if the bulllet has died in a pit and various other tasks that need constant updating.
	virtual void update(CPopView *pactiveview, Real dt);
	
	// Used to detect and properly handle collisions.
	int collidesWith(cCritter *pothercritter);
};

//============================ cCritterMathBall =======================================================================
class cCritterMathBall : public cCritterBullet
{
DECLARE_SERIAL(cCritterMathBall)
public:
	// Constructor
	cCritterMathBall();
	
	// Used to determine if the bullet has died in a pit and various other tasks that need constant updating.
	virtual void update(CPopView *pactiveview, Real dt);
	
	// Used to detect and properly handle collisions.
	virtual BOOL collide(cCritter *pcritter);
	int collidesWith(cCritter *pothercritter);
};

//============================ cCritterCannonBall =====================================================================
class cCritterPuke : public cCritterBullet
{
DECLARE_SERIAL(cCritterPuke)
public:
	// Constructor
	cCritterPuke();
	
	// Used to determine if the bullet has died in a pit and various other tasks that need constant updating.
	virtual void update(CPopView *pactiveview, Real dt);
	
	// Used to detect and properly handle collisions.
	int collidesWith(cCritter *pothercritter);
};

//==================== Non-Enemy object types: Coin, MathPower, PogoPower, Treasure =============

//============================ cCritterCoin ===========================================================================
class cCritterCoin : public cCritter
{
DECLARE_SERIAL(cCritterCoin)
public:
	// Constructors
	cCritterCoin(cGame *pownergame = NULL);
	cCritterCoin(cGame *pownergame, cVector location);
	
	// Used to determine if the coin has died in a pit and various other tasks that need constant updating.
	void update(CPopView *pactiveview, Real dt);
	
	// Used to detect and properly handle collisions.
	virtual BOOL collide(cCritter *pcritter);
	int cCritterCoin::collidesWith(cCritter *pothercritter);
};

//============================ cCritterMathPower ======================================================================
class cCritterMathPower : public cCritter
{
DECLARE_SERIAL(cCritterMathPower)
public:
	// Constructors
	cCritterMathPower(cGame *pownergame = NULL);
	cCritterMathPower(cGame *pownergame, cVector location);
	
	// Used to determine if the power-up has died in a pit and various other tasks that need constant updating.
	void update(CPopView *pactiveview, Real dt);
	
	// Used to detect and properly handle collisions.
	int cCritterMathPower::collidesWith(cCritter *pothercritter); /* Only collide
		with cCritterStubPlayer. */
};

//============================ cCritterPogoPower ======================================================================
class cCritterPogoPower : public cCritter
{
DECLARE_SERIAL(cCritterPogoPower)
public:
	// Constructors
	cCritterPogoPower(cGame *pownergame = NULL);
	cCritterPogoPower(cGame *pownergame, cVector location);
	
	// Used to determine if the power-up has died in a pit and various other tasks that need constant updating.
	void update(CPopView *pactiveview, Real dt);
	
	// Used to detect and properly handle collisions.
	int cCritterPogoPower::collidesWith(cCritter *pothercritter); /* Only collide
		with cCritterStubPlayer. */
};

//============================ cCritterStubTreasure ===================================================================
class cCritterStubTreasure : public cCritter
{ //A hollow circle.  objects disappear when they get fully inside it.
DECLARE_SERIAL(cCritterStubTreasure)
public:
	// Constructors
	cCritterStubTreasure(cGame *pownergame = NULL);
	cCritterStubTreasure(cGame *pownergame, cVector location);

	// Used to detect and properly handle collisions.
	virtual BOOL collide(cCritter *pcritter); //Checks if pcritter inside.
	int cCritterStubTreasure::collidesWith(cCritter *pothercritter); /* Only collide
		with cCritterStubPlayer. */
};

//====================== cGameStub ====================================================================================

class cGameStub : public cGame
{
DECLARE_SERIAL(cGameStub);

// Public Data
public:
	static Real TREASURERADIUS;

// Private Data
private:
	cCritterStubTreasure* _ptreasure;

// Public Functions
public:
	// Constructor
	cGameStub();

	virtual int worldShape(){return cGame::SHAPE_XSCROLLER;} 
		/* Need this to signal the cCritterViewer to not wobble up and down when
		 _trackplayer is on. Overrides the default worldShape of cGame::SHAPE_RECT.*/
	
	// This function is not used.  It exists solely to keep the superclass's seedCritters function from being called.
	virtual void seedCritters();

	// These functions modify the view of the playing area, doing changes like background image and zoom.
	virtual void initializeView(CPopView *pview);
	virtual void initializeViewpoint(cCritterViewer *pviewer); /* Move over to be above the
		lower left corner where the player is.  In 3D, use a low viewpoint low looking up. */
	
	// This function is used to change things that need constant check, such as death, earning a 1-Up, or changing levels.
	virtual void adjustGameParameters();

	// This function is used to adapt the message displayed in the lower left corner of the POP window that displays score
	// and number of lives left.
	virtual CString statusMessage();

	virtual void Serialize(CArchive& ar);
	
	// This function contains all the data of the levels hardcoded into it.  It controls what is created in each level, as
	// well as lending a hand when the game has been beaten.
	void loadLevel();
};


#endif //GAMESTUB_H