mcharacter.h
来自「基于SYMBIAN OS,series 60平台的经典游戏,超级马力」· C头文件 代码 · 共 111 行
H
111 行
///////////////////////////////////////////////////////////////////////////////
//
// 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 <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 + =
减小字号Ctrl + -
显示快捷键?