当前位置: 首页>>代码示例>>C++>>正文


C++ IServerUnknown::GetNetworkable方法代码示例

本文整理汇总了C++中IServerUnknown::GetNetworkable方法的典型用法代码示例。如果您正苦于以下问题:C++ IServerUnknown::GetNetworkable方法的具体用法?C++ IServerUnknown::GetNetworkable怎么用?C++ IServerUnknown::GetNetworkable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IServerUnknown的用法示例。


在下文中一共展示了IServerUnknown::GetNetworkable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

inline edict_t *BaseEntityToEdict(CBaseEntity *pEntity) {
	IServerUnknown *pUnk = (IServerUnknown *)pEntity;
	IServerNetworkable *pNet = pUnk->GetNetworkable();

	if(!pNet)
		return NULL;

	return pNet->GetEdict();
}
开发者ID:jonatan1024,项目名称:gorme,代码行数:9,代码来源:tmpbrush.cpp

示例2: OnEntityCreated

void CSourcePython::OnEntityCreated( CBaseEntity *pEntity )
{
	edict_t *pEdict;
	if (EdictFromBaseEntity(pEntity, pEdict)) {
		IServerUnknown* pServerUnknown = pEdict->GetUnknown();
		if (pServerUnknown)
			pEdict->m_pNetworkable = pServerUnknown->GetNetworkable();
	}
	CALL_LISTENERS(OnEntityCreated, ptr((CBaseEntityWrapper*) pEntity));
}
开发者ID:KirillMysnik,项目名称:Source.Python,代码行数:10,代码来源:sp_main.cpp

示例3: OnEntityCreated

void CSourcePython::OnEntityCreated( CBaseEntity *pEntity )
{
	int iIndex = IndexFromBaseEntity(pEntity);
	edict_t *pEdict = EdictFromIndex(iIndex);
	if (pEdict)
	{
		IServerUnknown* pServerUnknown = pEdict->GetUnknown();
		if (pServerUnknown)
			pEdict->m_pNetworkable = pServerUnknown->GetNetworkable();
	}
	CALL_LISTENERS(OnEntityCreated, iIndex, ptr((CBaseEntityWrapper*) pEntity));
}
开发者ID:Doldol,项目名称:Source.Python,代码行数:12,代码来源:sp_main.cpp

示例4: GetEntityWrapper

SMJS_Entity* GetEntityWrapper(CBaseEntity *pEntity){
	if(pEntity == NULL) return NULL;

	auto ref = gamehelpers->EntityToReference(pEntity);
	auto it = refs.find(ref);
	if(it != refs.end()) return it->second;

	IServerUnknown *pUnk = (IServerUnknown *)pEntity;
	IServerNetworkable *pNet = pUnk->GetNetworkable();

	SMJS_Entity *wrapper = new SMJS_Entity(pEntity);
	refs.insert(std::make_pair(ref, wrapper));
	return wrapper;
}
开发者ID:Kolpa,项目名称:SourceMod.js,代码行数:14,代码来源:MEntities.cpp

示例5: SetEntity

void SMJS_Entity::SetEntity(CBaseEntity *ent){
	if(this->ent != NULL){
		if(this->ent != ent){
			throw "Cannot set entity twice";
		}

		return;
	}

	this->valid = false;
	if(ent == NULL) return;

	this->ent = ent;

	IServerUnknown *pUnk = (IServerUnknown *)ent;
	IServerNetworkable *pNet = pUnk->GetNetworkable();
	if(pNet){
		edict = pNet->GetEdict();
		entIndex = gamehelpers->IndexOfEdict(edict);
	}

	this->valid = true;
}
开发者ID:1and1get2,项目名称:SourceMod.js,代码行数:23,代码来源:SMJS_Entity.cpp


注:本文中的IServerUnknown::GetNetworkable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。