本次为大家分析二人牛牛机器人构造源码如下:
#include "StdAfx.h"
#include
"AndroidServiceManager.h"
#include
"AndroidUserItemSink.h"
//////////////////////////////////////////////////////////////////////////
//构造函数
CGameServiceManager::CGameServiceManager()
{
}
//析构函数
CGameServiceManager::~CGameServiceManager()
{
}
//接口查询
void
* CGameServiceManager::QueryInterface(const IID & Guid, DWORD
dwQueryVer)
{
QUERYINTERFACE(IGameServiceManager,Guid,dwQueryVer);
QUERYINTERFACE_IUNKNOWNEX(IGameServiceManager,Guid,dwQueryVer);
return NULL;
}
//创建机器
VOID *
CGameServiceManager::CreateAndroidUserItemSink(REFGUID Guid, DWORD
dwQueryVer)
{
//变量定义
CAndroidUserItemSink *
pAndroidUserItemSink=NULL;
try
{
//建立对象
pAndroidUserItemSink=new
CAndroidUserItemSink();
if
(pAndroidUserItemSink==NULL) throw TEXT("创建失败");
//查询接口
VOID *
pObject=pAndroidUserItemSink->QueryInterface(Guid,dwQueryVer);
if (pObject==NULL) throw
TEXT("接口查询失败");
return
pObject;
}
catch (...)
{}
//删除对象
SafeDelete(pAndroidUserItemSink);
return
NULL;
}
//创建游戏桌
VOID *
CGameServiceManager::CreateTableFrameSink(REFGUID Guid, DWORD
dwQueryVer)
{
return NULL;
}
//创建数据
VOID
* CGameServiceManager::CreateGameDataBaseEngineSink(REFGUID Guid, DWORD
dwQueryVer)
{
return
NULL;
}
//获取属性
bool
CGameServiceManager::GetServiceAttrib(tagGameServiceAttrib &
GameServiceAttrib)
{
return
true;
}
//参数修改
bool
CGameServiceManager::RectifyParameter(tagGameServiceOption &
GameServiceOption)
{
//效验参数
ASSERT(&GameServiceOption!=NULL);
if
(&GameServiceOption==NULL) return false;
//单元积分
GameServiceOption.lCellScore
-=__max(1L,GameServiceOption.lCellScore);
//积分下限
GameServiceOption.lMinTableScore=__max(0L,GameServiceOption.lMinTableScore);
//积分上限
if
(GameServiceOption.lRestrictScore!=0L)
{
GameServiceOption.lRestrictScore=__max(GameServiceOption.lRestrictScore,GameServiceOption.lMinTableScore);
}
return
true;
}
//建立对象
DECLARE_CREATE_MODULE(GameServiceManager)
源码太多,不可能一次性分析,需要更多源码请继续关注我,或是直接访问棋牌社区下载。
二人牛牛机器人构造源码,码迷,mamicode.com