資源簡(jiǎn)介
網(wǎng)絡(luò)游戲基礎(chǔ)第16周,鋤大地源碼,代碼搜集于網(wǎng)絡(luò),僅供學(xué)習(xí)使用。

代碼片段和文件信息
#include?“Cards.h“
MSG_GAME_RESULT?g_GameResult;
vector?g_PlayerInfoArray;
bool?cmp(const?CDisplayCard?&a?const?CDisplayCard?&b){
return?a.cCard.Value?>?b.cCard.Value;??
}
bool?cmpIndex(const?CDisplayCard?&a?const?CDisplayCard?&b){
return?a.cCard.nIndex?>?b.cCard.nIndex;??
}
int?g_CartNo?=?0;
class?FindByCartNo?//用于查找編號(hào)
{
public:
bool?operator()?(vector::value_type&?pos)
{
if?(g_CartNo?==?pos.cCard.No)
{
return?true;
}
return?false;
}
};?
int?g_PlayerID?=?0;
class?FindByPlayerID?//用于查找編號(hào)
{
public:
bool?operator()?(vector::value_type&?pos)
{
if?(g_PlayerID?==?pos.dwPlayerID)
{
return?true;
}
return?false;
}
};?
CCards::CCards(void)
{
CardCur.resize(13);
CardRight.resize(13);
CardTop.resize(13);
CardLeft.resize(13);
bFirst=true;
bStart=false;
First3=true;
}
CCards::~CCards(void)
{
}
void?CCards::LoadSource()
{
srand((unsigned)time(NULL));?
Img_Pass=GetDisplay().LoadBitmapFile(“IMG_PASS.bmp“);
Img_Ok=GetDisplay().LoadBitmapFile(“IMG_OK.bmp“);
Ani_Time.LoadBitmapFile(“ANI_TIME.bmp“NULL);
Ani_Time.SetAnimInfo(12120910truetrue);
for(int?i=0;i<4;i++)
{
char?p[20];
sprintf(p“player/%d-1.bmp“rand()%100+1);
Img_Avatar[i]=GetDisplay().LoadBitmapFile(p);
}
}
void?CCards::AddPlayer(LPVOID?pPlayer)//添加一個(gè)用戶
{
MSG_PlayerINFO*?pNewPlayer=(MSG_PlayerINFO*)pPlayer;
g_PlayerInfoArray.push_back(pNewPlayer->PlayerInfo);
}
void?CCards::DelPlayer(LPVOID?pPlayer)//刪除一個(gè)用戶
{
}
USERINFO?CCards::FindPlayer(DWORD?iPlayerID)
{
vector::iterator?pPlayer;
g_PlayerID=iPlayerID;
pPlayer=find_if(g_PlayerInfoArray.begin()?g_PlayerInfoArray.end()?FindByPlayerID());
return?(*pPlayer);
}
void?CCards::AddAllPlayer(LPVOID?pAllPlayer)//添加所有用戶
{
MSG_ALLPlayerINFO*?AllPlayer=(MSG_ALLPlayerINFO*)pAllPlayer;
for(int?i=0;iyer->nPlayerNum;i++)
g_PlayerInfoArray.push_back(AllPlayer->PlayerInfoArray[i]);
}
void?CCards::InitNextGame()?//初始化下一局游戲
{
CardCur.clear();
CardLeft.clear();
CardTop.clear();
CardRight.clear();
CardCurPut.clear();
CardRightPut.clear();
CardTopPut.clear();
CardLeftPut.clear();
CardCurSel.clear();
CardCur.resize(13);
CardRight.resize(13);
CardTop.resize(13);
CardLeft.resize(13);
bFirst=true;
nPlayerStateCur=0;
nPlayerStateLeft=0;
nPlayerStateTop=0;
nPlayerStateRight=0;
}
void?CCards::GetResult(LPVOID?pResult)
{
memcpy((void*)&g_GameResultpResultsizeof(struct?MSG_GAME_RESULT));
char?tstr[50];
for(int?i=0;i<4;i++)
{
sprintf(tstr“%s得分是%d。%s“g_RoomPlayer[i].chPlayerNameg_GameResult.nNowScore[i]“\r\n“);
ShowText(tstr);
switch(GetDir(i))?//引得留一個(gè)接口,方便以后在勝負(fù)后除了顯示在文本框外,再設(shè)置些其它住處
{
case?0:
break;
case?1:
break;
case?2:
break;
case?3:
break;
}
}
}
int?CCards::GetDir(int?iGameNo)
{
if(MyGameNo==iGameNo)//本人用戶
return?0;
if((MyGame
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????77456??2009-04-29?02:25??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\ANI_TIME.bmp
?????文件??????11584??2009-04-29?01:51??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\BTN_CP.bmp
?????文件??????11584??2009-04-29?01:56??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\BTN_PASS.bmp
?????文件???????9272??2009-06-09?02:44??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\BTN_ROOM_JOIN.bmp
?????文件???????7808??2009-04-29?02:13??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\BTN_SORT.bmp
?????文件??????15252??2009-04-29?01:57??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\BTN_START.bmp
?????文件??????20764??2009-04-26?16:29??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp1.bmp
?????文件??????20764??2009-04-26?16:38??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp10.bmp
?????文件???????3532??2009-04-26?15:41??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp11.bmp
?????文件???????3532??2009-04-26?15:40??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp12.bmp
?????文件???????3532??2009-04-26?15:40??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp13.bmp
?????文件??????20764??2009-04-26?16:04??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp14.bmp
?????文件??????20764??2009-04-26?16:04??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp15.bmp
?????文件??????20764??2009-04-26?16:04??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp16.bmp
?????文件??????20764??2009-04-26?16:02??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp17.bmp
?????文件??????20764??2009-04-26?16:00??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp18.bmp
?????文件??????20764??2009-04-26?16:00??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp19.bmp
?????文件??????20764??2009-04-26?16:31??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp2.bmp
?????文件??????20764??2009-04-26?15:56??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp20.bmp
?????文件??????20764??2009-04-26?15:56??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp21.bmp
?????文件??????20764??2009-04-26?15:56??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp22.bmp
?????文件??????20764??2009-04-26?15:55??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp23.bmp
?????文件???????3532??2009-06-09?01:31??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp24.bmp
?????文件???????3532??2009-06-09?01:32??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp25.bmp
?????文件??????20764??2009-06-09?01:29??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp26.bmp
?????文件??????20764??2009-04-26?16:40??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp27.bmp
?????文件??????20764??2009-04-26?16:40??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp28.bmp
?????文件??????20764??2009-04-26?16:41??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp29.bmp
?????文件??????20764??2009-04-26?16:31??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp3.bmp
?????文件??????20764??2009-04-26?16:42??網(wǎng)絡(luò)游戲基礎(chǔ)第16周\GameClient\debug\cards\bmp30.bmp
............此處省略206個(gè)文件信息
- 上一篇:DOS622鏡像文件
- 下一篇:SFDC手冊(cè)開發(fā)
評(píng)論
共有 條評(píng)論