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

📄 blueprint.h

📁 hl2 source code. Do not use it illegal.
💻 H
字号:
#ifndef HK_PHYSICS_BLUEPRINT_H
#define HK_PHYSICS_BLUEPRINT_H

#ifndef HK_PHYSICS_BLUEPRINT_TYPES_H
#	include <hk_physics/types/blueprint_types.h>
#endif 


//: A Generic Blueprint for an object
// A blueprint is simply a chunk of memory that contains enough data to instantiate an object.
// An appropriate factory will take a blueprint and construct an appropriate object
// By their nature Blueprints are disposable - a persistent blueprint is also provided.
class hk_Blueprint
{
	public:
		inline hk_id get_id()   const;  
			//: returns the blueprint id

		inline hk_type get_type() const;  
			//: returns the blueprint type

		inline unsigned int get_size() const;  
			//: returns the blueprint data chunk size

		inline hk_size_t size_of() const;  
			//: returns the size of the blueprint including the header

	protected:
		inline hk_Blueprint( hk_type type, int size );
			//: Blueprint constructor 
			// The id is filled in automatically from the
			// static 'next_id' counter

		hk_Blueprint* clone();
			//: Clones this blueprint 
			// Give the clone a new id

		hk_id			m_id;
			//: The unique ID for this blueprint
		const hk_type	m_type;
			//: The type of object that can be built from the blueprint
		int				m_length;
			//: The length of the blueprint in bytes
};

class hk_Persistent_Blueprint : public hk_Blueprint
{
protected:
	hk_Persistent_Blueprint( hk_type type, int size ) : hk_Blueprint( type, size ){};
};

class hk_Disposable_Blueprint : public hk_Blueprint
{
protected:
	hk_Disposable_Blueprint( hk_type type, int size ) : hk_Blueprint( type, size ){};
};

#include <hk_physics/types/blueprint.inl>

#endif  // HK_PHYSICS_BLUEPRINT_H

⌨️ 快捷键说明

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