資源簡(jiǎn)介
超完美,可做大作業(yè),或?qū)嶒?yàn)內(nèi)容。想學(xué)習(xí)C#的可以下載參考哦
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Text;
using?System.Windows.Forms;
using?System.Drawing;
namespace?mycards
{
????public?class?Card?:?PictureBox
????{
????????//?Suit指的是花色,1為梅花,2為方鉆,3為紅心,4為黑桃?
????????private?byte?suit;???????????????//花色
????????private?byte?faceNum;????????????//?FaceNum?指的是牌面1--13數(shù)字(點(diǎn)數(shù))
????????private?byte?power;??????????????//?Power指的是牌的實(shí)際大小
????????private?Image?cardImage?=?null;??//牌的正面圖
????????private?Image?cardBackImage?=?null;?//牌的背面圖
????????public?Card(byte?Suit?byte?FaceNum)
????????{
????????????this.faceNum?=?FaceNum;
????????????this.suit?=?Suit;
????????????//設(shè)置實(shí)際大小,牌A比牌K大
????????????if?(FaceNum?==?1)?power?=?14;
????????????else?power?=?FaceNum;
????????}
????????public?Card()
????????{
????????}
????????public?byte?Suit??????????//花色屬性
????????{
????????????get
????????????{
????????????????return?suit;
????????????}
????????}
????????public?byte?Power???????//點(diǎn)數(shù)屬性
????????{
????????????get
????????????{
????????????????return?power;
????????????}
????????}
????????public?byte?FaceNum???????//牌的實(shí)際大小屬性
????????{
????????????get
????????????{
????????????????return?faceNum;
????????????}
????????}
????????public?int?pic_order()????//計(jì)算牌的圖像索引號(hào)
????????{
????????????return?(Suit?-?1)?*?13?+?FaceNum;
????????}
????????public?void?show()
????????{
????????????string?imageName?=“_“+pic_order().ToString();
????????????cardImage?=?(Image)Properties.Resources.ResourceManager.Getobject(imageName);
????????????//string?filename?=?Application.StartupPath+“\\..\\..\\bmp\\“?+?n.ToString()?+?“.bmp“;
????????????//cardImage=?Image.FromFile(filename);
????????????if?(cardImage?!=?null)
????????????????this.Image?=?cardImage;
????????}
????????public?void?showBack()
????????{
????????????string?imageName?=?“_0“;
????????????cardBackImage?=?(Image)Properties.Resources.ResourceManager.Getobject(imageName);
????????????if?(cardBackImage?!=?null)
????????????????this.Image?=?cardBackImage;
????????}
????????public?void?dian(int?n)?????//計(jì)算點(diǎn)數(shù)和花色
????????{
????????????this.faceNum?=?(byte)(n?%?13);
????????????this.suit?=?(byte)(n?/?13?+?1);
????????}
????????public?void?SetPosition(int?left?int?top)//牌的位置
????????{
????????????this.Left?=?left;
????????????this.Top?=?top;
????????}
????????public?void?SetSize(int?w?int?h)//牌的大小
????????{
????????????this.Width?=?w;?this.Height?=?h;
????????}
????????public?void?MoveTo(int?dx?int?dy)//動(dòng)畫(huà)效果
????????{
????????????int?x1?=?this.Left;
????????????int?y1?=?this.Top;
????????????for?(int?i?=?0;?i?10;?i++)
????????????{
????????????????SetPosition(x1?+?(dx?-?x1)?/?10?y1?+?(dy?-?y1)?/?10);???????????????????????????????
????????????}
????????????SetPosition(dxdy);
????????????this.BringToFront();
????????????//System.Threading.Thread.Sleep(30);???//延時(shí)0.03秒?
????????}
????????public?override?string?ToString()//重載ToString()方法
????????{
????????????string?Su
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件??????43008??2011-07-12?07:53??18章?拱豬撲克牌游戲\.vs\mycards\v14\.suo
?????文件????????903??2011-07-12?07:03??18章?拱豬撲克牌游戲\Backup\mycards.sln
?????文件?????232448??2011-07-12?07:07??18章?拱豬撲克牌游戲\bin\Debug\mycards.exe
?????文件??????75264??2011-07-12?07:07??18章?拱豬撲克牌游戲\bin\Debug\mycards.pdb
?????文件??????14328??2011-07-12?07:45??18章?拱豬撲克牌游戲\bin\Debug\mycards.vshost.exe
?????文件????????490??2007-07-21?09:33??18章?拱豬撲克牌游戲\bin\Debug\mycards.vshost.exe.manifest
?????文件??????20792??2007-10-18?17:54??18章?拱豬撲克牌游戲\bmp\0.bmp
?????文件???????1184??2007-10-18?17:47??18章?拱豬撲克牌游戲\bmp\1.bmp
?????文件???????1184??2007-10-18?17:49??18章?拱豬撲克牌游戲\bmp\10.bmp
?????文件???????3550??2007-10-18?17:49??18章?拱豬撲克牌游戲\bmp\11.bmp
?????文件???????3550??2007-10-18?17:49??18章?拱豬撲克牌游戲\bmp\12.bmp
?????文件???????3550??2007-10-18?17:49??18章?拱豬撲克牌游戲\bmp\13.bmp
?????文件???????1214??2007-10-18?17:49??18章?拱豬撲克牌游戲\bmp\14.bmp
?????文件???????1214??2007-10-18?17:49??18章?拱豬撲克牌游戲\bmp\15.bmp
?????文件???????1214??2007-10-18?17:50??18章?拱豬撲克牌游戲\bmp\16.bmp
?????文件???????1214??2007-10-18?17:50??18章?拱豬撲克牌游戲\bmp\17.bmp
?????文件???????1214??2007-10-18?17:50??18章?拱豬撲克牌游戲\bmp\18.bmp
?????文件???????1214??2007-10-18?17:50??18章?拱豬撲克牌游戲\bmp\19.bmp
?????文件???????1184??2007-10-18?17:47??18章?拱豬撲克牌游戲\bmp\2.bmp
?????文件???????1214??2007-10-18?17:50??18章?拱豬撲克牌游戲\bmp\20.bmp
?????文件???????1214??2007-10-18?17:50??18章?拱豬撲克牌游戲\bmp\21.bmp
?????文件???????1214??2007-10-18?17:50??18章?拱豬撲克牌游戲\bmp\22.bmp
?????文件???????1214??2007-10-18?17:50??18章?拱豬撲克牌游戲\bmp\23.bmp
?????文件???????3550??2007-10-18?17:50??18章?拱豬撲克牌游戲\bmp\24.bmp
?????文件???????3550??2007-10-18?17:51??18章?拱豬撲克牌游戲\bmp\25.bmp
?????文件???????3550??2007-10-18?17:51??18章?拱豬撲克牌游戲\bmp\26.bmp
?????文件???????1214??2007-10-18?17:51??18章?拱豬撲克牌游戲\bmp\27.bmp
?????文件???????1214??2007-10-18?17:51??18章?拱豬撲克牌游戲\bmp\28.bmp
?????文件???????1214??2007-10-18?17:51??18章?拱豬撲克牌游戲\bmp\29.bmp
?????文件???????1184??2007-10-18?17:48??18章?拱豬撲克牌游戲\bmp\3.bmp
............此處省略87個(gè)文件信息
評(píng)論
共有 條評(píng)論