cchrplayer.h

来自「symbian 下的mario游戏源代码」· C头文件 代码 · 共 84 行

H
84
字号
   /*
============================================================================
    * Name : CChrPlayer.h
    * Part of : 2DMario
    * Description : Definition of CChrPlayer
    * Copyright (c) 2007 Nokia Corporation
============================================================================
    */

#ifndef __CCHRPLAYER_H__
#define __CCHRPLAYER_H__

// INCLUDE FILES
#include <e32base.h>
#include "MCharacter.h"

// FORWARD DECLARATIONS
class CSprite;
class MSystem;
class CTileMap;

// CLASS DECLARATION

/**
* ChrPlayer class holds the behaviour of the player.
*/
class CChrPlayer
	: public CBase
	, public MCharacter
	{
	public:

		/**
		* Two-phased constructor.
		*/
		static CChrPlayer* NewL( CSprite* aSprite, MSystem* aSystem, CTileMap* aMap );
		
		/**
		* Destructor.
		*/			
		~CChrPlayer();

	private:
		
		/**
		* Default constructor
		*/		
		CChrPlayer( CSprite* aSprite, MSystem* aSystem, CTileMap* aMap);
		
		/**
		* Second phase constructor
		*/
		void ConstructL();

	public: // MCharacter
		
		void ActivateL();
		void Deactivate();
		void Draw( CBitmap& aTarget, const TPoint& aCamera );
		void Move();
		void SetPosition( const TPoint& aPosition );
		void Die();
		void SetType( const TChType& aChType );
		TPoint Position();
		CSprite* Sprite();
		TChType Type();

	private: // Data members

		CSprite* iSprite;
		MSystem* iSystem;
		CTileMap* iTileMap;
		TPoint iPosition;
		TPoint iSpeed;
		TInt iXDir;
		TInt iYDir;
		TBool iPlayerDead;
		TChType iChType;
	};

#endif

// End of file

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?