init
This commit is contained in:
43
Servers/服务器组件/游戏服务/GamePropertyManager.cpp
Normal file
43
Servers/服务器组件/游戏服务/GamePropertyManager.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#include "StdAfx.h"
|
||||
#include "GamePropertyManager.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//构造函数
|
||||
CGamePropertyManager::CGamePropertyManager()
|
||||
{
|
||||
}
|
||||
|
||||
//析构函数
|
||||
CGamePropertyManager::~CGamePropertyManager()
|
||||
{
|
||||
}
|
||||
|
||||
//设置道具
|
||||
bool CGamePropertyManager::SetGamePropertyInfo(tagPropertyInfo PropertyInfo[], WORD wPropertyCount)
|
||||
{
|
||||
//设置变量
|
||||
m_PropertyInfoArray.SetSize(wPropertyCount);
|
||||
|
||||
//拷贝数组
|
||||
CopyMemory(m_PropertyInfoArray.GetData(),PropertyInfo,sizeof(tagPropertyInfo)*wPropertyCount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//查找道具
|
||||
tagPropertyInfo * CGamePropertyManager::SearchPropertyItem(WORD wPropertyIndex)
|
||||
{
|
||||
//查找道具
|
||||
for (INT_PTR i=0;i<m_PropertyInfoArray.GetCount();i++)
|
||||
{
|
||||
if (m_PropertyInfoArray[i].wIndex==wPropertyIndex)
|
||||
{
|
||||
return &m_PropertyInfoArray[i];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
Reference in New Issue
Block a user