Form1.cs
(开头部分) 9KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
//08-5-23 将VB.net的转换成C#
using System;
using System.Runtime.InteropServices;
using System.Windows.Forms;
//add
namespace cards_csharp
{
public partial class Form1 : Form
{
private card[] Deck;
private int TopCard;
private int dealerAce; //庄家已有A牌个数
private int dealerCount; //庄家已有点数
private int g_height = 100;
private int g_width = 75;
private int idcard; //庄家已有扑克牌数
private int ipcard; //玩家已有扑克牌数
private int playerAce; //玩家已有A牌个数
private int playerCount; //玩家已有点数
public Form1()
{
InitializeComponent();
}
//初始化函数
[DllImport("cards.dll")]
public static extern bool cdtInit(ref int width, ref int height);
//显示扑克牌的函数
[DllImport("cards.dll")]
public static extern bool cdtDrawExt(IntPtr hdc, int x, int y, int dx, int dy, int card, int mode, int color);
//结束使用cards.dll函数
[DllImport("cards.dll")]
public static extern void cdtTerm();
private void GetDeck() //生成牌
{
int i;
int j;
for (i = 0; i <= 3; i++)
{
for (j = 0; j <= 12; j++)
{
Deck[j + 13*i].face = j;
Deck[j + 13*i].suit = i;
if (j < 10)
{
Deck[j + 13*i].count = j + 1;
}
else
{
Deck[j + 13*i].count = 10;
}
Deck[j + 13*i].faceup = false;
}
后面还有 246 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
