www.pudn.com > Example2D.rar > MCharacter.h


/////////////////////////////////////////////////////////////////////////////// 
// 
// MCharacter.h 
// 
// Copyright (c) 2003 Forum Nokia.  All rights reserved. 
// 
// 	 Technology developed by Rocket Science Oy Ltd 
// 
/////////////////////////////////////////////////////////////////////////////// 
 
#ifndef __MCHARACTER_H__ 
#define __MCHARACTER_H__ 
 
// INCLUDE FILES 
#include  
#include "CBitmap.h" 
 
// FORWARD DECLARATIONS 
class CSprite; 
class MSystem; 
 
// CONSTANTS 
enum TChType  
	{ 
	KPlayer, 
	KMonster, 
	KDiamond, 
	KDiamondBox, 
	KDiamondBoxCollected, 
	KCollected, 
	KUnsupported 
	}; 
 
// CLASS DECLARATION 
 
/** 
* MCharacter is a base class for the different character types 
* in the game 
*/ 
class MCharacter 
	{ 
	public: 
 
		/** 
		* Virtual destructor 
		*/ 
		virtual ~MCharacter() {} 
		 
		/** 
		* Activate object. 
		*/ 
		virtual void ActivateL() = 0; 
		 
		/** 
		* Deactivate object. 
		*/ 
		virtual void Deactivate() = 0; 
		 
		/** 
		* Draw object. 
		* @param aTarget Target bitmap. 
		* @param aCamera Camera position. 
		*/ 
		virtual void Draw( CBitmap& aTarget, const TPoint& aCamera ) = 0; 
 
		/** 
		* Move object. This is called by game timer. 
		*/		 
		virtual void Move() = 0; 
 
		/** 
		* Returns the position of object. 
		* @return TPoint Object position. 
		*/ 
		virtual TPoint Position() = 0; 
 
		/** 
		* Set the position of object. 
		* @param aPosition Object position. 
		*/ 
		virtual void SetPosition( const TPoint& aPosition ) = 0; 
		 
		/** 
		* Object has to die.  
		*/		 
		virtual void Die() = 0; 
 
 
		/** 
		* Set the type of object. 
		* @param aChType Object type. 
		*/ 
		virtual void SetType( const TChType& aChType ) = 0; 
 
		/** 
		* Get the type of object. 
		* @return TChType Type of the object. 
		*/		 
		virtual TChType Type() = 0; 
 
		/** 
		* Get the sprite of object. 
		* @return CSprite* Sprite of the object. 
		*/	 
		virtual CSprite* Sprite() = 0; 
	}; 
 
#endif 
 
// End of file