⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 propertiesmanager.h

📁 游戏框架
💻 H
字号:
#pragma once
#include "GameFrame.h"


struct tagRunningProperties{
	IGameProperties*		pProp;
	WORD					wType;
};


class GAME_FRAME_CLASS CPropertiesManager : public IGamePropertiesManager
{
protected:
	CListTemplate<IGameProperties*, DWORD>			m_lstProps;
	CListTemplate<tagRunningProperties*, DWORD>		m_lstCurrent;
	IGameProperties*								m_pChoose;
	WORD											m_wMaxProps;
	CGameLayer*										m_pLayer;			// 道具层

public:
	CPropertiesManager(WORD wMax=3);
	virtual ~CPropertiesManager(void);

public:
	// 添加道具
	virtual void __cdecl Add(IGameProperties* pIGameProp, INT_PTR nPosition = LISTTEMPLATE_LAST_ITEM);
	// 移除道具
	virtual void __cdecl Remove(INT_PTR nIndex);
	// 返回道具
	virtual IGameProperties* __cdecl Get(INT_PTR nIndex);

	// 设置为选择目标模式
	virtual void __cdecl SetChoose(IGameProperties* pGameProperties);
	// 系统使用道具(通知使用)
	virtual bool __cdecl SystemExecute(LPVOID lpParams);
	// 设置当前道具
	virtual void __cdecl ExecuteNotify(IGameProperties* pGameProperties, WORD wType = 0, bool bFlag=true);

	// 返回当前道具
	virtual IGameProperties* __cdecl GetCurrent(DWORD dwPropertiesID=0, bool bFlag=false);
	// 返回当前要选择目标的道具
	virtual IGameProperties* __cdecl GetChoose();
	// 是否有道具使用中
	virtual BOOL __cdecl IsUsing(DWORD dwPropertiesID=0);
	// 是否有道具选择目标中
	virtual BOOL __cdecl IsChoosing();
	// 设置最大道具携带数
	virtual void __cdecl SetMax(WORD wMax);
	// 设置关联的层对象
	virtual void __cdecl SetLayer(CGameLayer* pLayer);

	//模板方法
public:
	//是否有效
	virtual bool __cdecl IsValid() { return AfxIsValidAddress(this,sizeof(CPropertiesManager))?true:false;};
	//释放对象
	virtual bool __cdecl Release() { if(IsValid()){ delete this; return true;} else return false; };
	//接口查询
	virtual void * __cdecl QueryInterface(const IID & Guid, DWORD dwQueryVer);
};

⌨️ 快捷键说明

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