categoryhandler.h

来自「这是整套横扫千军3D版游戏的源码」· C头文件 代码 · 共 35 行

H
35
字号
#ifndef __CATEGORY_HANDLER_H__
#define __CATEGORY_HANDLER_H__

#include <string>
#include <vector>
#include <map>
#include <boost/noncopyable.hpp>

class CCategoryHandler : public boost::noncopyable
{
	CR_DECLARE(CCategoryHandler);

public:
	static CCategoryHandler* Instance() {
		if (instance == NULL) instance = SAFE_NEW CCategoryHandler();
		return instance;
	}
	static void RemoveInstance();

	unsigned int GetCategory(std::string name);
	unsigned int GetCategories(std::string names);
	std::vector<std::string> GetCategoryNames(unsigned int bits) const;

private:
	static CCategoryHandler* instance;

	CCategoryHandler();
	~CCategoryHandler();

	std::map<std::string,unsigned int> categories;
	int firstUnused;
};

#endif // __CATEGORY_HANDLER_H__

⌨️ 快捷键说明

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