📄 mcharacter.h
字号:
/*
============================================================================
* Name : MCharacter.h
* Part of : 2DMario
* Description : Definition of MCharacter
* Copyright (c) 2007 Nokia Corporation
============================================================================
*/
#ifndef __MCHARACTER_H__
#define __MCHARACTER_H__
// INCLUDE FILES
#include <e32std.h>
#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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -