91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 487KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-19
  • 語言: C/C++
  • 標簽: 三國殺??C++??

資源簡介

采用C++開發的基于控制臺的應用程序. 完成三國殺部分基本功能:殺,閃,桃,無中生有,過河拆橋,無懈可擊,順手牽羊,諸葛連弩,青釭劍,+1馬,-1馬. 三國殺最復雜之處在于邏輯性直觀但是很不好把握.

資源截圖

代碼片段和文件信息

#include?“stdafx.h“
#include?“card.h“
#include?“heap.h“
#include?“util.h“

//Card

ostream&?operator<<(ostream?&outCard?&cd)
{
char?*cl[]={“““黑桃““紅心““梅花““方片“};
out<<“[“< if(cd.value==1)??out<<“A“;
else??out< cout<<“]“;
return?out;
}

//Equipment

Equipment::Equipment()
{
for(int?i=0;i<4;i++)
equip[i]=NULL;
}
Equipment::~Equipment()
{
for(int?i=0;i<4;i++)
delete?equip[i];
}
ostream&?operator<<(ostream?&outEquipment?&eq)
{
out<<“[裝備]:??“;
for(int?i=0;i<4;i++)
{
out< if(eq[i]!=NULL)
out<<*(eq[i]);
out<<“??“;
}
return?out;
}
void?Equipment::add(Card*?cd)
{
int?k;
switch(cd->type)
{
case?7:
case?8:?k=0;?break;
case?9:
case?10:?k=1;?break;
case?11:?k=2;?break;
case?12:?k=3;?break;
default:?return;
}
//如果裝備區原本有牌則需收集
if(equip[k]!=NULL)
hp.collect(equip[k]);
equip[k]=cd;
}
void?Equipment::remove(int?kbool?bring)
{
//如果不是順手則收集
if(!bring)
hp.collect(equip[k]);
equip[k]=NULL;
}
int?Equipment::count()
{
int?cn=0;
for(int?i=0;i<4;i++)
if(equip[i]!=NULL)
cn++;
return?cn;
}
bool?Equipment::has(int?type)
{
for(int?i=0;i<4;i++)
if(equip[i]!=NULL&&equip[i]->type==type)
return?true;
return?false;
}
Card*?Equipment::operator[](int?k)
{
return?equip[k];
}

//Hand

Hand::Hand()
{
top=0;
for(int?i=0;i<10;i++)
hand[i]=NULL;
}
Hand::~Hand()
{
for(int?i=0;i<10;i++)
delete?hand[i];
}
ostream&?operator<<(ostream?&outHand?&hd)
{
out<<“[手牌]:“< for(int?i=0;i {
out< if((i+1)%4==0)
cout< }
return?out;
}
void?Hand::add(Card*?cd)
{
hand[top]=cd;
top++;
}
void?Hand::remove(int?kbool?bring)
{
int?last=top-1;
if(!bring)
hp.collect(hand[k]);
hand[k]=hand[last];
hand[last]=NULL;
top--;
}
int?Hand::count()
{
return?top;
}
int?Hand::has(int?type)
{
for(int?i=0;i if(hand[i]->type==type)
{
return?i;
}
return?-1;
}
Card*?Hand::operator[](int?k)
{
return?hand[k];
}

//People

People::People(char?*chbool?_me)
{
life=max_life=4;
strcpy_s(namech);
me=_me;
}
void?People::disp()
{
int?y=0yy=getY();
if(!me)??y=7;
clear(y5);??gotoxy(y);
cout< cout< gotoxy(yy);
}
void?People::entry(People?&other)
{
first=true;
cal_dis(other);
}
void?People::cal_dis(People?&other)
{
int?ki=1br=1;
//我有青釭劍
if(eq.has(8))??ki++;
//他有+1馬
if(other.eq.has(11))
{
ki--;
br--;
}
//我有-1馬
if(eq.has(12))
{ ki++;
br++;
}
bkill=(ki>=1)?true:false;
bring=(br>=1)?true:false;
}
//0=無??1=僅裝備??2=僅手牌??3=都有
int?People::cards()
{
int?cn=0;
if(eq.count()>0)??cn?+=?1;
if(hd.co

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-01-06?13:29??三國殺\
?????目錄???????????0??2012-01-06?13:29??三國殺\Debug\
?????文件??????104448??2012-01-06?13:26??三國殺\Debug\三國殺.exe
?????目錄???????????0??2012-01-06?12:18??三國殺\ipch\
?????目錄???????????0??2012-01-06?12:18??三國殺\ipch\三國殺-b3493956\
?????文件?????2359296??2012-01-06?13:18??三國殺\ipch\三國殺-b3493956\三國殺-26ca9512.ipch
?????目錄???????????0??2012-01-04?12:51??三國殺\三國殺\
?????文件?????????894??2012-01-03?13:00??三國殺\三國殺.sln
?????文件???????17920??2012-01-06?13:29??三國殺\三國殺.suo
?????文件???????11314??2012-01-06?13:26??三國殺\三國殺\card.cpp
?????文件????????2034??2012-01-06?13:10??三國殺\三國殺\card.h
?????目錄???????????0??2012-01-06?13:28??三國殺\三國殺\Debug\
?????文件????????2168??2012-01-06?13:28??三國殺\三國殺\Debug\三國殺.Build.CppClean.log
?????文件????????1856??2012-01-05?18:33??三國殺\三國殺\heap.cpp
?????文件?????????584??2012-01-06?13:07??三國殺\三國殺\heap.h
?????文件????????1567??2012-01-03?13:00??三國殺\三國殺\ReadMe.txt
?????文件?????????490??2012-01-06?12:54??三國殺\三國殺\sgs.txt
?????文件?????????211??2012-01-03?13:00??三國殺\三國殺\stdafx.cpp
?????文件?????????233??2012-01-03?13:00??三國殺\三國殺\stdafx.h
?????文件?????????236??2012-01-03?13:00??三國殺\三國殺\targetver.h
?????文件????????1254??2012-01-06?13:10??三國殺\三國殺\util.h
?????文件?????????161??2012-01-05?18:00??三國殺\三國殺\三國殺.cpp
?????文件????????4554??2012-01-04?12:52??三國殺\三國殺\三國殺.vcxproj
?????文件????????1747??2012-01-04?12:52??三國殺\三國殺\三國殺.vcxproj.filters
?????文件?????????143??2012-01-03?13:00??三國殺\三國殺\三國殺.vcxproj.user
?????文件?????????402??2012-01-06?13:36??三國殺\說明.txt

評論

共有 條評論