Commit 64600e54 authored by 花桃白音's avatar 花桃白音

添加项目文件。

parent d4a231f6

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.6.33829.357
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cardvisa", "cardvisa\cardvisa.csproj", "{E5F42D33-F3E4-4B43-A3DA-C51F1CA9F94A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E5F42D33-F3E4-4B43-A3DA-C51F1CA9F94A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5F42D33-F3E4-4B43-A3DA-C51F1CA9F94A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5F42D33-F3E4-4B43-A3DA-C51F1CA9F94A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5F42D33-F3E4-4B43-A3DA-C51F1CA9F94A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06C49654-3D73-4371-8A67-E0C5C32CD80E}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin"/>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
namespace cardvisa
{
partial class Form1
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.listBox1 = new System.Windows.Forms.ListBox();
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.button4 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.button6 = new System.Windows.Forms.Button();
this.button7 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(12, 415);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "签出打包";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(93, 415);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 1;
this.button2.Text = "(未实现)";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button3
//
this.button3.Location = new System.Drawing.Point(174, 415);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(75, 23);
this.button3.TabIndex = 2;
this.button3.Text = "打开库";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
//
// listBox1
//
this.listBox1.Font = new System.Drawing.Font("宋体", 12F);
this.listBox1.FormattingEnabled = true;
this.listBox1.ItemHeight = 16;
this.listBox1.Location = new System.Drawing.Point(12, 12);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(237, 388);
this.listBox1.TabIndex = 3;
this.listBox1.SelectedValueChanged += new System.EventHandler(this.listBox1_SelectedValueChanged);
//
// richTextBox1
//
this.richTextBox1.Font = new System.Drawing.Font("宋体", 12F);
this.richTextBox1.Location = new System.Drawing.Point(256, 13);
this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(532, 387);
this.richTextBox1.TabIndex = 4;
this.richTextBox1.Text = "";
//
// button4
//
this.button4.Location = new System.Drawing.Point(256, 414);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(75, 23);
this.button4.TabIndex = 5;
this.button4.Text = "导出卡表";
this.button4.UseVisualStyleBackColor = true;
this.button4.Click += new System.EventHandler(this.button4_Click);
//
// button5
//
this.button5.Location = new System.Drawing.Point(337, 415);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(75, 23);
this.button5.TabIndex = 7;
this.button5.Text = "测试";
this.button5.UseVisualStyleBackColor = true;
this.button5.Click += new System.EventHandler(this.button5_Click);
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(668, 275);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(120, 120);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 8;
this.pictureBox1.TabStop = false;
this.pictureBox1.Visible = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// button6
//
this.button6.Location = new System.Drawing.Point(766, 377);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(22, 18);
this.button6.TabIndex = 9;
this.button6.Text = "△";
this.button6.UseVisualStyleBackColor = true;
this.button6.Click += new System.EventHandler(this.button6_Click);
//
// button7
//
this.button7.Location = new System.Drawing.Point(419, 414);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(75, 23);
this.button7.TabIndex = 10;
this.button7.Text = "button7";
this.button7.UseVisualStyleBackColor = true;
this.button7.Click += new System.EventHandler(this.button7_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.button7);
this.Controls.Add(this.button6);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.button5);
this.Controls.Add(this.button4);
this.Controls.Add(this.richTextBox1);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.button3);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "厨师签证中心";
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.ListBox listBox1;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button7;
}
}
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Data.SQLite;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Dynamic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Web;
using System.Windows.Forms;
using System.Xml.Linq;
using cardvisa.Properties;
using NLua;
namespace cardvisa
{
public partial class Form1 : Form
{
static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"bin\");
path = Path.Combine(path, args.Name.Split(',')[0]);
path = string.Format(@"{0}.dll", path);
path = string.Format(@"{0}.xml", path);
return System.Reflection.Assembly.LoadFrom(path);
}
public Form1()
{
InitializeComponent();
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
SettingPath();
}
public SettingData settings;
public CDBTableHelper cdbh = new CDBTableHelper();
public List<string> zipcdblist { get; set; } = new List<string>();
public int cardindex = 0;
public int cardcounts = 0;
public void SettingPath()
{
string configpath = Application.StartupPath + "\\setting.json";
if (!File.Exists(configpath))
{
settings = new SettingData(); ;
string jsonString = JsonSerializer.Serialize(settings);
File.WriteAllText(configpath, jsonString);
}
if (File.Exists(configpath))
{
string json = File.ReadAllText(configpath);
settings = JsonSerializer.Deserialize<SettingData>(json);
if (File.Exists(settings.ygopath))
{
settings.pathcheck = true;
}
else
{
OpenFileDialog dialog = new OpenFileDialog();
if (dialog.ShowDialog() == DialogResult.OK)
{
settings.ygopath = dialog.FileName;
string jsonString = JsonSerializer.Serialize(settings);
File.WriteAllText(configpath, jsonString);
}
}
refreshlist();
}
}
private void button1_Click(object sender, EventArgs e)
{
//将卡片签出
if (button3.Text == "关闭库")
{
//下一页
PageFillList(-1);
}
else
{
checkDirectory();
string targetfile = Application.StartupPath + "\\checkout\\package.cdb";
string dir = Application.StartupPath + "\\checkin";
Director(dir, "cdb");
cdbh.Execute(targetfile);
if (cdbh.cardlistex.Count > 0)
{
cdbh.Execute(Application.StartupPath + "\\checkout\\NotAllowedFiles\\TypeErrorCards.cdb", false);
}
Director(dir, "ascdb");
DeckPackOut("#default");
foreach (var item in zipcdblist) { File.Delete(item); }
refreshlist();
MessageBox.Show("“快速”打包完成");
}
}
private void button2_Click(object sender, EventArgs e)
{
//将卡片签入到服务器
if (button3.Text == "关闭库")
{
//下一页
PageFillList(1);
}
else
{
}
}
private void button3_Click(object sender, EventArgs e)
{
if (button3.Text == "关闭库")
{
button1.Text = "签出打包";
button2.Text = "签入";
button3.Text = "打开库";
button4.Text = "导出卡表";
refreshlist();
}
else
{
button1.Text = "上一页";
button2.Text = "下一页";
button3.Text = "关闭库";
button4.Text = "判决通知";
var id = listBox1.SelectedIndex;
string txtFilePath = "";
if (id > 0)
{
txtFilePath = Application.StartupPath + "\\checkout\\" + listBox1.Items[id].ToString();
}
else
{
using (OpenFileDialog ofd = new OpenFileDialog())
{
ofd.Filter = "文本文件|*.cdb";
if (ofd.ShowDialog() == DialogResult.OK)
{
txtFilePath = ofd.FileName;
}
}
}
FillListBoxFromCDB((txtFilePath == "" ? Application.StartupPath + "\\checkout\\package.cdb" : txtFilePath));
}
}
private void button4_Click(object sender, EventArgs e)
{
string txtFilePath = "";
var id = listBox1.SelectedIndex;
if (id > 0)
{
txtFilePath = Application.StartupPath + "\\checkout\\" + listBox1.Items[id].ToString();
}
else
{
if (button3.Text != "关闭库")
{
using (OpenFileDialog ofd = new OpenFileDialog())
{
ofd.Filter = "文本文件|*.cdb";
if (ofd.ShowDialog() == DialogResult.OK) txtFilePath = ofd.FileName;
}
}
}
if (button3.Text == "关闭库")
{
LflistPackOut(Application.StartupPath + "\\checkout");
}
else
{
if (txtFilePath != "") DeckPackOut(txtFilePath);
}
}
private void button5_Click(object sender, EventArgs e)
{
string tpath = Application.StartupPath + "\\checkout\\test.txt";
LuaDebug debug = new LuaDebug();
debug.Show();
TaskFile tskf = new TaskFile();
Lua rua = new Lua();
rua.RegisterFunction("ReadText",tskf,tskf.GetType().GetMethod("ReadText"));
rua.RegisterFunction("AppendText", tskf, tskf.GetType().GetMethod("AppendText"));
rua.DoString(@"
function main(path)
AppendText(path,' 你好,世界')
return 0
end
").ToString();
var ruaFunc = rua["main"] as LuaFunction;
debug.Print(ruaFunc.Call(tpath).First().ToString());
}
private void button6_Click(object sender, EventArgs e)
{
if (pictureBox1.Visible)
{
button6.Text = "△";
pictureBox1.Visible = false;
}
else
{
button6.Text = "×";
pictureBox1.Visible = true;
}
}
private void button7_Click(object sender, EventArgs e)
{
}
public void refreshlist()
{
listBox1.Items.Clear();
listBox1.Items.Add("选择文件");
DIRForEachFilesThenCallback(Application.StartupPath + "\\checkout", (Action<dynamic>)((fsinfo) => {
if (!(fsinfo is DirectoryInfo))
{
if (fsinfo.Name.Contains(".cdb")) listBox1.Items.Add(fsinfo.Name);
}
}));
}
public void checkDirectory(string path = "checkout")
{
string dir = Application.StartupPath + "\\" + path;
if (!Directory.Exists(dir)) Directory.CreateDirectory(dir);
List<string> dirs = new List<string> { "temp", "pics", "pics\\field", "script", "text", "deck", "NotAllowedFiles" };
string targetfile = Application.StartupPath + "\\" + path + "\\package.cdb";
CommonHandler.CreateCDBFiles(targetfile);
foreach (var item in dirs)
{
string temp = dir + "\\" + item;
if (!string.IsNullOrEmpty(temp))
{
if (!Directory.Exists(temp)) Directory.CreateDirectory(temp);
}
}
}
public void FillListBoxFromCDB(string pathName)
{
if (File.Exists(pathName))
{
string constr = "Data Source=" + pathName + ";";
SqliteDataContext db = new SqliteDataContext(constr);
var datassets = (from q1 in db.Datarows select q1).ToList();
var textssets = (from q2 in db.Textrows select q2).ToList();
cardindex = 0;
cardcounts = datassets.Count() > textssets.Count() ? datassets.Count() : textssets.Count();
cdbh.Dispose();
for (int i = 0; i < cardcounts; i++)
{
var cardd = datassets[i];
cdbh.Add(new sqldata(cardd.id, DateTime.Now, textssets[i], cardd, false));
}
PageFillList();
LflistReader();
}
}
public void PageFillList(int page = 0)
{
int maxp = (int)Math.Ceiling((double)cardcounts / 20);
int fromindex = cardindex;
cardindex = (page > 1 ? page - 1 : cardindex + page);
if (cardindex < 0)
{
cardindex = 0;
}
else if (cardindex >= maxp)
{
cardindex = maxp - 1;
}
if ((cardindex != fromindex) || cardindex == 0)
{
listBox1.Items.Clear();
listBox1.Items.Add("选择文件");
int ii = 0;
int cardid = cardindex * 20;
int maxlg = cardid + 20 > cardcounts ? cardcounts : cardid + 20;
for (; (cardid + ii < maxlg); ii++)
{
long cardcode = cdbh.cardlist[cardid + ii];
string cardname = cdbh.cmds[cardcode].cmdt.name;
listBox1.Items.Add((ii + 1) + "||" + cardcode + "||" + cardname);
}
listBox1.Items.Add("第" + (cardindex + 1) + "页/共" + Math.Ceiling((double)cardcounts / 20) + "页");
}
}
public void StreamCopy(string sourcePath, string targetPath, string text) {
bool allowedfile = true;
string legaltype = "";
if (Regex.IsMatch(text, "xpcall"))
{
allowedfile = false;
legaltype = "usexpcall_";
}
if (Regex.IsMatch(text, "goto"))
{
allowedfile = false;
legaltype = "usegoto_";
}
text = text.Replace("\r\n", "\n");
if (allowedfile)
{
using (StreamWriter sw = new StreamWriter(targetPath, false, (new UTF8Encoding(false)))) { sw.Write(text); }
}
else
{
if (sourcePath != "fromzip")
{
File.Copy(sourcePath, Application.StartupPath + "\\checkout\\NotAllowedFiles\\" + legaltype + Path.GetFileName(sourcePath), true);
}
else
{
using (StreamWriter sw = new StreamWriter(Application.StartupPath + "\\checkout\\NotAllowedFiles\\" + legaltype + Path.GetFileName(targetPath), false, (new UTF8Encoding(false)))) { sw.Write(text); }
}
}
}
public void StreamCopy(string sourcePath, string targetPath)
{
using (StreamReader sr = new StreamReader(sourcePath))
{
string text = sr.ReadToEnd();
StreamCopy(sourcePath,targetPath,text);
}
}
public bool CompressImage(Image imgSource, string targetPath, int quality = 75, int maxsize = 120, bool sfsc = true, int rar4x = 2) {
ImageFormat tFormat = imgSource.RawFormat;
int dHeight = imgSource.Height / rar4x;
int dWidth = imgSource.Width / rar4x;
int sW = 0, sH = 0;
//按比例缩放
Size tem_size = new Size(imgSource.Width, imgSource.Height);
if (tem_size.Width > dHeight || tem_size.Width > dWidth)
{
if ((tem_size.Width * dHeight) > (tem_size.Width * dWidth))
{
sW = dWidth;
sH = (dWidth * tem_size.Height) / tem_size.Width;
}
else
{
sH = dHeight;
sW = (tem_size.Width * dHeight) / tem_size.Height;
}
}
else
{
sW = tem_size.Width;
sH = tem_size.Height;
}
Bitmap ob = new Bitmap(dWidth, dHeight);
Graphics g = Graphics.FromImage(ob);
g.Clear(Color.White);
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
g.DrawImage(imgSource, new Rectangle((dWidth - sW) / 2, (dHeight - sH) / 2, sW, sH), 0, 0, imgSource.Width, imgSource.Height, GraphicsUnit.Pixel);
g.Dispose();
//保存图片并压缩
EncoderParameters ep = new EncoderParameters();
long[] qy = new long[1];
qy[0] = quality;
EncoderParameter eParam = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, qy);
ep.Param[0] = eParam;
try
{
ImageCodecInfo[] arrayICI = ImageCodecInfo.GetImageEncoders();
ImageCodecInfo jpegICIinfo = null;
for (int x = 0; x < arrayICI.Length; x++)
{
if (arrayICI[x].FormatDescription.Equals("JPEG"))
{
jpegICIinfo = arrayICI[x];
break;
}
}
if (jpegICIinfo != null)
{
ob.Save(targetPath, jpegICIinfo, ep);
FileInfo fi = new FileInfo(targetPath);
if (fi.Length > 1024 * maxsize)
{
quality = quality - 10;
CompressImage(imgSource, targetPath, quality, maxsize, false, sfsc ? 2 : 4);
}
}
else
{
ob.Save(targetPath, tFormat);
}
return true;
}
catch { return false; }
finally
{
imgSource.Dispose();
ob.Dispose();
}
}
public bool CompressImage(string sourcePath, string targetPath, int quality = 75, int maxsize = 120, bool sfsc = true, int rar4x = 2)
{
FileInfo firstFileInfo = new FileInfo(sourcePath);
if (sfsc == true && firstFileInfo.Length < maxsize * 1024)
{
firstFileInfo.CopyTo(targetPath, true);
return true;
}
Image imgSource = Image.FromFile(sourcePath);
return CompressImage(imgSource, targetPath, quality, maxsize, sfsc, rar4x);
}
public void DIRForEachFilesThenCallback(string dir, dynamic cbk)
{
DirectoryInfo d = new DirectoryInfo(dir);
FileSystemInfo[] fsinfos = d.GetFileSystemInfos();
foreach (FileSystemInfo fsinfo in fsinfos)
{
if (cbk is Action<dynamic>) cbk(fsinfo);
}
}
public void DeckPackOut(string txtFilePath)
{
string folderpath = txtFilePath == "#default" ? Application.StartupPath + "\\checkout\\deck" : "";
txtFilePath = txtFilePath == "#default" ? Application.StartupPath + "\\checkout\\package.cdb" : txtFilePath;
if (File.Exists(txtFilePath))
{
string constr = "Data Source=" + txtFilePath + ";";
SqliteDataContext db = new SqliteDataContext(constr);
var idsets = (from q1 in db.Idrows select q1);
var excodelist = new List<string>();
var maincodelist = new List<string>();
foreach (var card in idsets)
{
var code = card.id;
var type = card.type;
var dexA = Convert.ToString(type, 16);
var excard = false;
/*
融合=0x40,
同调=0x2000
超量=0x800000
连接=0x4000000
*/
if (!excard && dexA.Length >= 2)
{
string a = dexA.Substring(dexA.Length - 2, 1);
excard = excard ? excard : CommonHandler.dexf(a, 4);
}
if (!excard && dexA.Length >= 4)
{
string a = dexA.Substring(dexA.Length - 4, 1);
excard = excard ? excard : CommonHandler.dexf(a, 2);
}
if (!excard && dexA.Length >= 6)
{
string a = dexA.Substring(dexA.Length - 6, 1);
excard = excard ? excard : CommonHandler.dexf(a, 8);
}
if (!excard && dexA.Length >= 7)
{
string a = dexA.Substring(dexA.Length - 7, 1);
excard = excard ? excard : CommonHandler.dexf(a, 4);
}
if (excard)
{
excodelist.Add(code.ToString());
}
else
{
maincodelist.Add(code.ToString());
}
}
//准备输出文件
Func<int, string> c2o = (n) => {
switch (n)
{
case 11:
case 12:
case 13:
return $"{n}th";
default:
string n2t = n.ToString();
char lastd = n2t[n2t.Length - 1];
string suffix = "";
switch (lastd)
{
case '1':
suffix = "st";
break;
case '2':
suffix = "nd";
break;
case '3':
suffix = "rd";
break;
default:
suffix = "th";
break;
}
return $"{n}{suffix}";
}
};
if (folderpath == "")
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.Description = "请选择卡组文件要保存到的目录文件夹";
if (dialog.ShowDialog() == DialogResult.OK)
{
folderpath = dialog.SelectedPath;
}
}
double mc = Math.Ceiling((double)(((double)maincodelist.Count) / 40));
double ec = Math.Ceiling((double)(((double)excodelist.Count) / 15));
int page = (int)(mc > ec ? (int)mc : (int)ec);
for (int i = 0; i < page; i++)
{
string content = "#created by hakune";
content += "\r\n#main";
for (int mj = 0; (i * 40 + mj) < maincodelist.Count && (i * 40 + mj) < (i + 1) * 40; mj++)
{
content += "\r\n" + maincodelist[i * 40 + mj];
}
content += "\r\n#extra";
for (int ej = 0; (i * 15 + ej) < excodelist.Count && (i * 15 + ej) < (i + 1) * 15; ej++)
{
content += "\r\n" + excodelist[i * 15 + ej];
}
string filename = DateTime.Now.ToString("yyyy-MM-dd") + " " + c2o(i + 1) + ".ydk";
string path = folderpath + "\\" + filename;
using (StreamWriter sw = new StreamWriter(path, false, (new UTF8Encoding(false))))
{
sw.Write(content.Replace("\r\n", "\n"));
}
}
Process.Start("explorer.exe", folderpath);
}
}
public void LflistReader(string path = "")
{
if(path == "") path = Application.StartupPath + "\\checkout\\lflist.txt";
if (!File.Exists(path))
{
using (StreamWriter sw = new StreamWriter(path, false, (new UTF8Encoding(false)))) { sw.Write(""); }
}
else
{
string[] strsets = File.ReadAllLines(path);
string reg = "(?<id>\\d{1,10})\\s(?<lf>\\d).*(?<=[-]{2})(?<name>.*)";
foreach (var str in strsets)
{
Match mt = Regex.Match(str,reg);
if (mt.Success)
{
long cid = long.Parse(mt.Groups["id"].Value);
if (cdbh.cmds.ContainsKey(cid)) {
cdbh.cmds[cid].LFState = (LFStates)Enum.Parse(typeof(LFStates), mt.Groups["lf"].Value);
}
}
}
}
}
public void LflistPackOut(string txtFilePath)
{
List<string> list = new List<string> { "#forbidden", "#limit", "#semi limit", "#Passed", "#Returned" };
foreach (long cid in cdbh.cardlist)
{
sqldata sqd = cdbh.cmds[cid];
list[(int)sqd.LFState] += "\n" + sqd.cmdd.id.ToString().PadLeft(8, '0') + " " + (int)sqd.LFState + " --" + sqd.cmdt.name;
}
string content = list[0] + "\n" + list[1] + "\n" + list[2] + "\n" + list[4] + "\n" + list[3];
using (StreamWriter sw = new StreamWriter(txtFilePath + "\\lflist.txt", false, (new UTF8Encoding(false))))
{
sw.Write(content.Replace("\r\n", "\n"));
}
Process.Start("explorer.exe", txtFilePath);
}
public void Director(string dir)
{
Director(dir, "#default");
}
public void Director(string dir, string mode)
{
DirectoryInfo d = new DirectoryInfo(dir);
FileSystemInfo[] fsinfos = d.GetFileSystemInfos();
foreach (FileSystemInfo fsinfo in fsinfos)
{
if (fsinfo is DirectoryInfo)
{
Director(fsinfo.FullName, mode);
}
else
{
string flag = "";
if (mode == "#default" || mode == "excdb" || mode == "ascdb")
{
if (fsinfo.FullName.Contains(".cdb") && mode != "excdb" && mode != "ascdb")
{
flag = "cdb";
}
else
{
if (fsinfo.FullName.Contains(".lua") && mode == "ascdb") flag = "script";
if (fsinfo.FullName.Contains(".jpg") && fsinfo.FullName.Contains("thumbnail") != true) flag = "pics";
if (fsinfo.FullName.Contains(".txt")) flag = "text";
if (fsinfo.FullName.Contains(".zip")) flag = "zip";
}
}
else
{
if (fsinfo.FullName.Contains("." + mode)) flag = mode;//cdb入口
if (fsinfo.FullName.Contains(".cdb")) flag = "cdb";
if (fsinfo.FullName.Contains(".zip")) flag = "cdb";
}
swtodo(fsinfo, flag);
}
}
}
public void swtodo(FileSystemInfo fsinfo, string flag)
{
bool allowedfile = false;
int icd = 0;
if (int.TryParse(fsinfo.Name.Replace(fsinfo.Extension, "").Replace("c", ""), out icd)) allowedfile = cdbh.cardlist.Contains(icd) ? true : false;
switch (flag)
{
case "text":
case "script":
case "pics":
//需要直接复制过去
string pathtemp = Application.StartupPath + "\\checkout\\" + (allowedfile ? (fsinfo.FullName.Contains("field") ? "pics\\field\\" : flag + "\\") : fsinfo.FullName.Contains(".txt") ? "text\\" : "NotAllowedFiles\\") + fsinfo.Name;
DateTime dt = File.GetLastWriteTime(pathtemp);
if (!File.Exists(pathtemp) || (fsinfo.LastWriteTime > dt))
{
if (flag == "pics")
{
CompressImage(fsinfo.FullName, pathtemp);
}
else
{
StreamCopy(fsinfo.FullName, pathtemp);
}
}
break;
case "cdb":
case "zip":
if (File.Exists(fsinfo.FullName))
{
if (fsinfo.FullName.Contains(".cdb"))
{
cdbh.AddFromCDB(fsinfo.FullName);
}
else
{
using (var zip = ZipFile.OpenRead(fsinfo.FullName))
{
foreach (var entry in zip.Entries)
{
string flag2 = "";
if (flag == "cdb")
{
if (entry.Name.Contains(".cdb")) flag2 = "cdb";
}
else
{
if (entry.Name.Contains(".lua")) flag2 = "script";
if (entry.Name.Contains(".jpg") && entry.Name.Contains("thumbnail") != true) flag2 = "pics";
if (entry.Name.Contains(".txt")) flag2 = "text";
}
switch (flag2)
{
case "text":
case "script":
case "pics":
icd = 0;
int.TryParse(entry.Name.Replace(Path.GetExtension(entry.Name), "").Replace("c", ""), out icd);
allowedfile = cdbh.cardlist.Contains(icd) ? true : false;
string tgpath = Application.StartupPath + "\\checkout\\" + (allowedfile ? (entry.FullName.Contains("field") ? "pics\\field\\" : flag2 + "\\") : entry.FullName.Contains(".txt") ? "text\\" : "NotAllowedFiles\\") + entry.Name;
DateTime dtt = File.GetLastWriteTime(tgpath);
if (!File.Exists(tgpath) || (entry.LastWriteTime.DateTime > dtt))
{
using (var stream = entry.Open())
{
if (flag2 == "pics")
{
Image img = Image.FromStream(stream);
CompressImage(img, tgpath);
}
else
{
using (var sr = new StreamReader(stream))
{
var str = sr.ReadToEnd();
if (entry.Name != "")
{
StreamCopy("fromzip", tgpath, str);
}
}
}
}
}
break;
case "cdb":
if (entry.Name.Contains("cdb"))
{
tgpath = Application.StartupPath + "\\checkout\\temp\\" + fsinfo.Name.Replace(".zip", "--") + entry.Name;
if (File.Exists(tgpath))
{
File.Delete(tgpath);
}
entry.ExtractToFile(tgpath);
cdbh.AddFromCDB(tgpath);
zipcdblist.Add(tgpath);
}
break;
default:
break;
}
}
}
}
}
break;
default:
break;
}
}
public long GetCardFromListID() {
var id = listBox1.SelectedIndex;
if(id>0 &&id < 20)
{
int cid = cardindex * 20 + id - 1;
cid = cid >= cardcounts ? cardcounts - 1 : cid;
long cidd = cdbh.cardlist[cid];
return cidd;
}
return 0;
}
private void listBox1_SelectedValueChanged(object sender, EventArgs e)
{
if (button3.Text == "关闭库")
{
var id = listBox1.SelectedIndex;
if (id > 0 && id < 20)
{
sqldata sqd = cdbh.cmds[GetCardFromListID()];
string ctp = Convert.ToString(sqd.cmdd.type, 16);
CardTypeInfo ctpinfo = new CardTypeInfo(ctp);
ctpinfo.cdinit(sqd.cmdd.race, "race");
ctpinfo.cdinit(sqd.cmdd.attribute, "attr");
var lv = ctpinfo.GetLevel(sqd.cmdd.level);
richTextBox1.Text = "";
try
{
List<string> list = new List<string> {"0禁止.jpg","1限制.jpg","2准限.jpg","3通过.jpg","4回退.jpg"};
string imgpath = Application.StartupPath + "\\res\\" + list[(int)sqd.LFState];
if (File.Exists(imgpath))
{
Image img = Image.FromFile(imgpath);
pictureBox1.Image = img;
button6.Text = "×";
pictureBox1.Visible = true;
}
}
catch (Exception exc)
{
richTextBox1.Text += exc.ToString();
}
richTextBox1.Text =
sqd.cmdt.name + "[" + sqd.cmdd.id + "]" + "\r\n" +
(ctpinfo.IsCardType("怪兽") ? "[怪兽|" +
ctpinfo.CardTypeFormat("怪兽") +
"] " + ctpinfo.CardTypeFormat("", "|", "race") + "/" + ctpinfo.CardTypeFormat("", "|", "attr")
+ "\r\n"
+ "[" + (ctpinfo.IsCardType("超量") ? "☆" : (ctpinfo.IsCardType("连接") ? "LINK-" : "★")) + lv + "] "
+ "攻击力:" + sqd.cmdd.atk +
(ctpinfo.IsCardType("连接") ? "" : " / 守备力:" + sqd.cmdd.def) :
(ctpinfo.IsCardType("魔法") ? "[魔法" +
ctpinfo.CardTypeFormat("魔法", "|", "type", "|") +
"]" :
(ctpinfo.IsCardType("陷阱") ? "[陷阱|" +
ctpinfo.CardTypeFormat("陷阱", "|", "type", "|") +
"]" : "[卡种错误]"))) + "\r\n" +
sqd.cmdt.desc;
}
if (id > 20 || cardindex * 20 + id - 1 == cardcounts)
{
Form fm1 = new Form();
fm1.Size = new Size(160, 100);
fm1.StartPosition = FormStartPosition.CenterParent;
System.Windows.Forms.Label lb = new System.Windows.Forms.Label();
lb.Location = new Point(15, 12);
lb.Size = new Size(60, 20);
lb.Font = new Font("宋体", 12F);
lb.Text = "转跳到";
TextBox tbx = new TextBox();
tbx.Location = new Point(75, 10);
tbx.Size = new Size(60, 23);
Button btnyes = new Button();
btnyes.Location = new Point(10, 33);
btnyes.Size = new Size(60, 23);
btnyes.Text = "确定";
Button btnno = new Button();
btnno.Location = new Point(75, 33);
btnno.Size = new Size(60, 23);
btnno.Text = "取消";
Action<bool> act = (bool flag) =>
{
if (flag)
{
int pageid = cardindex;
int.TryParse(tbx.Text, out pageid);
PageFillList(pageid);
}
fm1.Close();
fm1.Dispose();
};
tbx.KeyDown += (object obj, KeyEventArgs args) => {
string inputValue = tbx.Text;
if (args.KeyCode == Keys.Enter) act(true);
};
btnyes.Click += (object obj, EventArgs args) => { act(true); };
btnno.Click += (object obj, EventArgs args) => { act(false); };
fm1.Controls.Add(lb);
fm1.Controls.Add(tbx);
fm1.Controls.Add(btnyes);
fm1.Controls.Add(btnno);
fm1.ShowDialog();
}
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
Form fm1 = new Form();
string path = Application.StartupPath + "\\res\\";
fm1.Size = new Size(365,280);
fm1.StartPosition = FormStartPosition.CenterParent;
List<string> list = new List<string> {
"0禁止.jpg","1限制.jpg","2准限.jpg","3通过.jpg","4回退.jpg"
};
List<string> emname = new List<string> { "Forbidden", "Limited", "SubLimited", "UnLimited", "死刑" };
List<PictureBox> pblist = new List<PictureBox> {
new PictureBox(),new PictureBox(),new PictureBox(),new PictureBox(),new PictureBox()
};
int id = 0;
foreach (var pb in pblist)
{
pb.Visible = true;
pb.SizeMode = PictureBoxSizeMode.Zoom;
pb.Size = new Size(120, 120);
pb.Location = new Point((id - 3 >= 0 ? (id - 3) * 120 : id * 120), (id - 3 >= 0 ? 120 : 0));
pb.Image = Image.FromFile(path + list[id]);
pb.Name = emname[id];
pb.Click += (object sder,EventArgs args) => {
PictureBox pbn = sder as PictureBox;
pictureBox1.Image = pbn.Image;
if (button3.Text == "关闭库")
{
var cid = listBox1.SelectedIndex;
if (cid > 0 && cid < 20)
{
sqldata sqd = cdbh.cmds[GetCardFromListID()];
sqd.LFState = (LFStates)Enum.Parse(typeof(LFStates), pbn.Name);
}
}
fm1.Close();
fm1.Dispose();
};
fm1.Controls.Add(pb);
id++;
}
fm1.ShowDialog();
}
}
[Table(Name = "main.datas")]
public class datas
{
[Column(Name = "id", IsPrimaryKey = true)]
public UInt32 id { get; set; }
[Column(Name = "ot")]
public Int64 ot { get; set; }
[Column(Name = "alias")]
public Int64 alias { get; set; }
[Column(Name = "setcode")]
public Int64 setcode { get; set; }
[Column(Name = "type")]
public Int64 type { get; set; }
[Column(Name = "atk")]
public Int64 atk { get; set; }
[Column(Name = "def")]
public Int64 def { get; set; }
[Column(Name = "level")]
public Int64 level { get; set; }
[Column(Name = "race")]
public Int64 race { get; set; }
[Column(Name = "attribute")]
public Int64 attribute { get; set; }
[Column(Name = "category")]
public Int64 category { get; set; }
public string getInsertcmd()
{
return "INSERT OR REPLACE INTO datas VALUES ("
+ id.ToString() + ","
+ ot.ToString() + ","
+ alias.ToString() + ","
+ setcode.ToString() + ","
+ type.ToString() + ","
+ atk.ToString() + ","
+ def.ToString() + ","
+ level.ToString() + ","
+ race.ToString() + ","
+ attribute.ToString() + ","
+ category.ToString() + ");"
;
}
}
[Table(Name = "main.texts")]
public class texts
{
[Column(Name = "id", IsPrimaryKey = true)]
public Int64 id { get; set; }
[Column(Name = "name", DbType = "text")]
public string name { get; set; }
[Column(Name = "desc", DbType = "text")]
public string desc { get; set; }
[Column(Name = "str1", DbType = "text")]
public string str1 { get; set; }
[Column(Name = "str2", DbType = "text")]
public string str2 { get; set; }
[Column(Name = "str3", DbType = "text")]
public string str3 { get; set; }
[Column(Name = "str4", DbType = "text")]
public string str4 { get; set; }
[Column(Name = "str5", DbType = "text")]
public string str5 { get; set; }
[Column(Name = "str6", DbType = "text")]
public string str6 { get; set; }
[Column(Name = "str7", DbType = "text")]
public string str7 { get; set; }
[Column(Name = "str8", DbType = "text")]
public string str8 { get; set; }
[Column(Name = "str9", DbType = "text")]
public string str9 { get; set; }
[Column(Name = "str10", DbType = "text")]
public string str10 { get; set; }
[Column(Name = "str11", DbType = "text")]
public string str11 { get; set; }
[Column(Name = "str12", DbType = "text")]
public string str12 { get; set; }
[Column(Name = "str13", DbType = "text")]
public string str13 { get; set; }
[Column(Name = "str14", DbType = "text")]
public string str14 { get; set; }
[Column(Name = "str15", DbType = "text")]
public string str15 { get; set; }
[Column(Name = "str16", DbType = "text")]
public string str16 { get; set; }
public string getInsertcmd()
{
return "INSERT OR REPLACE INTO texts VALUES ("
+ id.ToString() + ",'"
+ name.Replace("'", "''") + "','"
+ desc.Replace("'", "''") + "','"
+ str1.Replace("'", "''") + "','"
+ str2.Replace("'", "''") + "','"
+ str3.Replace("'", "''") + "','"
+ str4.Replace("'", "''") + "','"
+ str5.Replace("'", "''") + "','"
+ str6.Replace("'", "''") + "','"
+ str7.Replace("'", "''") + "','"
+ str8.Replace("'", "''") + "','"
+ str9.Replace("'", "''") + "','"
+ str10.Replace("'", "''") + "','"
+ str11.Replace("'", "''") + "','"
+ str12.Replace("'", "''") + "','"
+ str13.Replace("'", "''") + "','"
+ str14.Replace("'", "''") + "','"
+ str15.Replace("'", "''") + "','"
+ str16.Replace("'", "''") + "');";
}
}
[Table(Name = "main.datas")]
public class ids
{
[Column(Name = "id", IsPrimaryKey = true)]
public Int64 id { get; set; }
[Column(Name = "type")]
public Int64 type { get; set; }
}
public enum LFStates:int
{
Forbidden = 0,
Limited = 1,
SubLimited = 2,
UnLimited = 3,
死刑 = 4
}
public class CommonHandler
{
public static bool dexf(string a, int b)
{
Dictionary<string, List<int>> list = new Dictionary<string, List<int>>
{
["0"] = new List<int> { 0 },
["1"] = new List<int> { 1 },
["2"] = new List<int> { 2 },
["3"] = new List<int> { 1, 2 },
["4"] = new List<int> { 4 },
["5"] = new List<int> { 1, 4 },
["6"] = new List<int> { 2, 4 },
["7"] = new List<int> { 1, 2, 4 },
["8"] = new List<int> { 8 },
["9"] = new List<int> { 1, 8 },
["a"] = new List<int> { 2, 8 },
["b"] = new List<int> { 1, 2, 8 },
["c"] = new List<int> { 4, 8 },
["d"] = new List<int> { 1, 4, 8 },
["e"] = new List<int> { 2, 4, 8 },
["f"] = new List<int> { 1, 2, 4, 8 }
};
return list[a].Contains(b) ? true : false;
}
public static void CreateCDBFiles(string filePath)
{
if (!File.Exists(filePath))
{
SQLiteConnection.CreateFile(filePath);
if (File.Exists(filePath))
{
SQLiteConnection strconn = new SQLiteConnection("data source=" + filePath);
if (strconn.State != ConnectionState.Open)
{
strconn.Open();
SQLiteCommand cmd = strconn.CreateCommand();
cmd.Connection = strconn;
cmd.CommandText = "CREATE TABLE IF NOT EXISTS datas(id integer PRIMARY KEY NOT NULL,ot integer,alias integer,setcode integer,type integer,atk integer,def integer,level integer,race integer,attribute integer,category integer)";
cmd.ExecuteNonQuery();
cmd.CommandText = "CREATE TABLE IF NOT EXISTS texts(id integer PRIMARY KEY NOT NULL,name text,desc text,str1 text,str2 text,str3 text,str4 text,str5 text,str6 text,str7 text,str8 text,str9 text,str10 text,str11 text,str12 text,str13 text,str14 text,str15 text,str16 text)";
cmd.ExecuteNonQuery();
}
strconn.Close();
}
}
}
}
public class SqliteDataContext : DataContext
{
public Table<ids> Idrows
{
get { return GetTable<ids>(); }
}
public Table<datas> Datarows
{
get { return GetTable<datas>(); }
}
public Table<texts> Textrows
{
get { return GetTable<texts>(); }
}
public SqliteDataContext(string connection, MappingSource mappingSource) : base(connection, mappingSource) { }
public SqliteDataContext(IDbConnection connection, MappingSource mappingSource) : base(connection, mappingSource) { }
public SqliteDataContext(string connectionString) : base(new SQLiteConnection(connectionString)) { }
public SqliteDataContext(IDbConnection connection) : base(connection) { }
}
public class SettingData
{
public string ygopath { get; set; } = "";
public bool pathcheck { get; set; } = false;
public bool packDIY { get; set; } = true;
public List<string> regs { get; set; }
}
public class sqldata
{
public long code;
public DateTime time;
public texts cmdt { get; set; }
public datas cmdd { get; set; }
public LFStates LFState { get; set; }
public sqldata(long c, DateTime dt, texts cdt, datas cdd, bool packDIY)
{
code = c; time = dt; cmdt = cdt; cmdd = packDIY ? cdd : CheckDatas(cdd, true); LFState = LFStates.UnLimited;
}
public datas CheckDatas(datas cdd, bool packDIY)
{
if (packDIY) { cdd.ot = 4; }
return cdd;
}
}
public class CDBTableHelper
{
public List<long> cardlist = new List<long>();
public List<long> cardlistex = new List<long>();
public bool packDIY { get; set; } = true;
public Dictionary<long, sqldata> cmds = new Dictionary<long, sqldata>();
public void Dispose()
{
cardlist.Clear();
cmds.Clear();
}
public void Add(sqldata sqd, bool flag = true)
{
if (flag)
{
cardlist.Add(sqd.code);
}
else
{
cardlistex.Add(sqd.code);
}
cmds.Add(sqd.code, sqd);
}
public void AddFromCDB(string path)
{
FileInfo fsinfo = new FileInfo(path);
string constr = "Data Source=" + fsinfo.FullName + ";";
SqliteDataContext db = new SqliteDataContext(constr);
var datassets = (from q1 in db.Datarows select q1).ToList();
var textssets = (from q2 in db.Textrows select q2).ToList();//.Skip(0).Take(30);
int maxlg = datassets.Count() > textssets.Count() ? datassets.Count() : textssets.Count();
for (int i = 0; i < maxlg; i++)
{
var cardd = datassets[i];
var cardt = textssets[i];
var code = cardd.id;
CardTypeInfo cti = new CardTypeInfo(cardd.type);
var iflegaltype = cti.IsLegalType();
if (cmds.ContainsKey(code))
{
if ((fsinfo.LastWriteTime > cmds[code].time) && (!iflegaltype))//需要更新数据
{
cmds[code].time = fsinfo.LastWriteTime;
cmds[code].cmdd = cardd;
cmds[code].cmdt = cardt;
}
}
else//直接添加数据
{
Add(new sqldata(code, fsinfo.LastWriteTime, cardt, cardd, packDIY), iflegaltype);
}
}
db.Dispose();
}
public void EXEMission(SQLiteConnection cn, string tbn, List<string> lst, bool flag = true)
{
SQLiteTransaction ts = cn.BeginTransaction();
string sql = "select " + lst.Aggregate("", (c, s) => c + (s + ",")).TrimEnd(',') + " from " + tbn;
SQLiteDataAdapter dta = new SQLiteDataAdapter(sql, cn);
SQLiteCommandBuilder scb = new SQLiteCommandBuilder(dta);
dta.UpdateCommand = scb.GetUpdateCommand();
DataSet DS = new DataSet();
dta.FillSchema(DS, SchemaType.Source, "Temp");
dta.Fill(DS, "Temp");
DataTable DT = DS.Tables["Temp"];
foreach (long codeid in (flag ? cardlist : cardlistex))
{
sqldata sqd = cmds[codeid];
DataRow DR = DT.NewRow();
var tpro = sqd.GetType().GetProperty(tbn == "datas" ? "cmdd" : "cmdt").GetValue(sqd, null);
for (int i = 0; i < lst.Count; i++)
{
DR[i] = tpro.GetType().GetProperty(lst[i]).GetValue(tpro, null);
}
if (!DT.Rows.Contains(DR[0])) DT.Rows.Add(DR);
}
dta.Update(DT);
ts.Commit();
DS.AcceptChanges();
//释放资源
dta.Dispose();
DS.Clear();
}
public void Execute(string targetfile, bool flag = true)
{
List<string> datalist1 = new List<string> { "id", "ot", "alias", "setcode", "type", "atk", "def", "level", "race", "attribute", "category" };
List<string> datalist2 = new List<string> { "id", "name", "desc", "str1", "str2", "str3", "str4", "str5", "str6", "str7", "str8", "str9", "str10", "str11", "str12", "str13", "str14", "str15", "str16" };
if (flag) { cardlist.Sort(); } else { cardlistex.Sort(); }
CommonHandler.CreateCDBFiles(targetfile);
SQLiteConnection cn = new SQLiteConnection("Data Source=" + targetfile);
cn.Open();
EXEMission(cn, "datas", datalist1, flag);
EXEMission(cn, "texts", datalist2, flag);
cn.Close();
cn.Dispose();
}
}
public class CardTypeInfo
{
public CardTypeInfo(long cid)
{
string ctp = Convert.ToString(cid, 16);
cdinit(ctp);
}
public CardTypeInfo(string ctp)
{
cdinit(ctp);
}
List<string> cardTypeList = new List<string> {
"怪兽","魔法","陷阱","0x8",
"通常","效果","融合","仪式",
"陷阱怪兽","灵魂","同盟","二重",
"调整","同调","衍生物","0x8000",
"速攻","永续","装备","场地",
"反击","反转","卡通","超量",
"灵摆","特殊召唤","连接","0x8000000"
};
List<string> cardAttrList = new List<string>{
"地","水","炎","风","光","暗","神"
};
List<string> cardRaceList = new List<string>{
"战士族族","魔法师族","天使族","恶魔族",
"不死族族","机械族","水族","炎族",
"岩石族","鸟兽族","植物族","昆虫族",
"雷族","龙族","兽族","兽战士族",
"恐龙族","鱼族","海龙族","爬虫类族",
"念动力族","幻神兽族","创造神族","幻龙族",
"电子界族"
};
List<string> cardTypeRules = new List<string>
{
"通常,效果,魔法,陷阱",
"仪式,融合,同调,超量,连接,特殊召唤",
"速攻,装备,永续,场地,仪式",
"永续,反击"
};
Dictionary<string, bool> cardTypeDict = new Dictionary<string, bool>();
public void cdinit(long cid, string name = "type")
{
cdinit(Convert.ToString(cid, 16), name);
}
public void cdinit(string ctp, string name = "type")
{
Dictionary<string, List<int>> list = new Dictionary<string, List<int>>
{
["0"] = new List<int> { 0 },
["1"] = new List<int> { 1 },
["2"] = new List<int> { 2 },
["3"] = new List<int> { 1, 2 },
["4"] = new List<int> { 3 },
["5"] = new List<int> { 1, 3 },
["6"] = new List<int> { 2, 3 },
["7"] = new List<int> { 1, 2, 3 },
["8"] = new List<int> { 4 },
["9"] = new List<int> { 1, 4 },
["a"] = new List<int> { 2, 4 },
["b"] = new List<int> { 1, 2, 4 },
["c"] = new List<int> { 3, 4 },
["d"] = new List<int> { 1, 3, 4 },
["e"] = new List<int> { 2, 3, 4 },
["f"] = new List<int> { 1, 2, 3, 4 }
};
for (int i = 0; i < ctp.Length; i++)
{
if (list.ContainsKey(ctp[ctp.Length - 1 - i].ToString()))
{
foreach (int item in list[ctp[ctp.Length - 1 - i].ToString()])
{
if (item > 0)
{
string temp = "";
switch (name)
{
case "type":
temp = cardTypeList[i * 4 + item - 1];
break;
case "attr":
temp = cardAttrList[i * 4 + item - 1];
break;
case "race":
temp = cardRaceList[i * 4 + item - 1];
break;
default:
break;
}
cardTypeDict[temp] = true;
}
}
}
}
}
public int GetLevel(long lv)
{
string rt = Convert.ToString(lv, 16);
rt = rt.Length >= 2 ? rt.Substring(rt.Length - 1, 1) : rt;
return Convert.ToInt32(rt, 16);
}
public int GetRank(long lv)
{
string rt = Convert.ToString(lv, 16);
rt = rt.Length >= 4 ? rt.Substring(rt.Length - 2, 1) : rt;
return Convert.ToInt32(rt);
}
public bool IsCardType(string typeName)
{
return cardTypeDict.ContainsKey(typeName) ? cardTypeDict[typeName] : false;
}
public bool IsCardAttribute(string attrName)
{
return IsCardType(attrName);
}
public bool IsCardRace(string raceName)
{
return IsCardType(raceName + "族");
}
public bool IsLegalType()
{
//匹配性检查
int ctpc = cardTypeDict.Keys.Count;
int index = 1;
foreach (var item in new List<string> { "怪兽", "魔法", "陷阱" })
{
if (cardTypeDict.ContainsKey(item))
{
if (ctpc == 0 || (ctpc == 1 && item == "怪兽")) { return false; }//无种类或仅有怪兽时
if (ctpc == 1 && index > 1) { return true; }//仅有魔法、陷阱时
string mted = "";
foreach (var ctemp in cardTypeRules[index].Split(','))
{//2种类时必须满足魔法和陷阱条件
if (cardTypeDict.ContainsKey(ctemp))
{
if (ctpc <= 2) { return true; }
else if (mted == "") { mted = ctemp; }
else { return false; } //大于3时匹配到多个条件,进行唯一性检查
}
}
}
index++;
}
//多种类的冲突性检查
foreach (var ctRule in cardTypeRules)
{
bool legaled1 = false; bool legaled2 = false;
foreach (var item in ctRule.Split(','))
{
if (legaled2) { return false; }
else
{
legaled2 = legaled1 ? (cardTypeDict.ContainsKey(item) ? cardTypeDict[item] : false) : legaled2;
legaled1 = legaled1 ? legaled1 : (cardTypeDict.ContainsKey(item) ? cardTypeDict[item] : false);
}
}
}
return true;
}
public string CardTypeFormat(string ex = "", string patt = "|", string name = "type", string prefix = "", string suffix = "")
{
string rt = "";
var exName = ex.Split(',');
foreach (var cardTypeName in cardTypeDict.Keys)
{
if (cardTypeDict[cardTypeName] && !exName.Contains(cardTypeName))
{
switch (name)
{
case "type":
if (cardTypeList.Contains(cardTypeName)) { rt += cardTypeName + patt; }
break;
case "attr":
if (cardAttrList.Contains(cardTypeName)) { rt += cardTypeName + patt; }
break;
case "race":
if (cardRaceList.Contains(cardTypeName)) { rt += cardTypeName + patt; }
break;
default:
break;
}
}
}
return (prefix + rt + suffix).TrimEnd('|');
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms.VisualStyles;
using System.IO;
using NLua;
using System.Windows.Forms;
using System.Drawing;
namespace cardvisa
{
public class LuaTask
{
Lua myLua = new Lua();
private string fileName { get; set; }
}
public class LuaDebug
{
public Form cons = new Form();
public TextBox tbxlog = new TextBox();
public LuaDebug() {
cons.Text = "调试输出";
cons.Size = new Size(400,250);
cons.StartPosition = FormStartPosition.CenterParent;
tbxlog.Location = new Point(0, 0);
tbxlog.Multiline = true;
tbxlog.Dock = DockStyle.Fill;
cons.Controls.Add(tbxlog);
}
public void Show() { cons.Show(); }
public void Close() { cons.Close(); }
public void Print(string text) { tbxlog.Text += text; }
}
public class TaskFile
{
private string fileFullName { get; set; }
public TaskFile() { }
public TaskFile(string path) { fileFullName = path; }
public string GetName() { return Path.GetFileNameWithoutExtension(fileFullName); }
public string GetNameEx() { return Path.GetFileName(fileFullName); }
public string GetExtension() { return Path.GetExtension(fileFullName); }
public string GetFullName() { return fileFullName; }
//public string GetDirectoryName() { return Path.get; }
public string GetDirectoryFullName() { return Path.GetDirectoryName(fileFullName); }
public bool MakeDir(string path)
{
if (!Directory.Exists(path)) { Directory.CreateDirectory(path); return true; } else { return false; }
}
public bool RemoveDir(string path)
{
if (Directory.Exists(path)) { Directory.Delete(path, true); return true; } else { return false; }
}
public bool Copy(string source, string target)
{
if (File.Exists(source) && !File.Exists(target)) { File.Copy(source, target); return true; } else { return false; }
}
public bool Move(string source, string target)
{
if (File.Exists(source) && !File.Exists(target)) { File.Move(source, target); return true; } else { return false; }
}
public bool Rename(string source, string target)
{
if (File.Exists(source) && !File.Exists(target)) { File.Move(source, target); return true; } else { return false; }
}
public bool Delete(string source)
{
if (File.Exists(source)) { File.Delete(source); return true; } else { return false; }
}
public string ReadText(string source) {
if (File.Exists(source)) { return File.ReadAllText(source,Encoding.UTF8); } else { return null; }
}
public string[] ReadAllLines(string source) {
if (File.Exists(source)) { return File.ReadAllLines(source); } else { return null; }
}
public bool AppendText(string source, string text)
{
if (File.Exists(source)) {
using (StreamWriter sw = File.AppendText(source)) { sw.WriteLine(text); }
return true;
} else { return false; }
}
public bool CreateText(string source, string text)
{
if (File.Exists(source)) { File.CreateText(source).WriteLine(text); return true; } else { return false; }
}
public bool ReaplaceText(string path, string patt1, string patt2)
{
if (File.Exists(path)) { File.CreateText(path).WriteLine(File.ReadAllText(path).Replace(patt1, patt2)); return true; } else { return false; }
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace cardvisa
{
internal static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("cardvisa")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("cardvisa")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("e5f42d33-f3e4-4b43-a3da-c51f1ca9f94a")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace cardvisa.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("cardvisa.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace cardvisa.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.6.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E5F42D33-F3E4-4B43-A3DA-C51F1CA9F94A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>cardvisa</RootNamespace>
<AssemblyName>cardvisa</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="KeraLua, Version=1.3.4.0, Culture=neutral, PublicKeyToken=6a194c04b9c89217, processorArchitecture=MSIL">
<HintPath>..\packages\KeraLua.1.3.4\lib\net46\KeraLua.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.7.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="NLua, Version=1.6.3.0, Culture=neutral, PublicKeyToken=6a194c04b9c89217, processorArchitecture=MSIL">
<HintPath>..\packages\NLua.1.6.3\lib\net46\NLua.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Linq" />
<Reference Include="System.Data.SQLite">
<HintPath>.\System.Data.SQLite.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data.SQLite.Linq">
<HintPath>.\System.Data.SQLite.Linq.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.IO.Compression.ZipFile, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Runtime.InteropServices, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.InteropServices.4.3.0\lib\net462\System.Runtime.InteropServices.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Text.Encodings.Web, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.7.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Text.Json, Version=7.0.0.3, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.7.0.3\lib\net462\System.Text.Json.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="LuaTask.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\KeraLua.1.3.4\build\net46\KeraLua.targets" Condition="Exists('..\packages\KeraLua.1.3.4\build\net46\KeraLua.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\KeraLua.1.3.4\build\net46\KeraLua.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\KeraLua.1.3.4\build\net46\KeraLua.targets'))" />
</Target>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="KeraLua" version="1.3.4" targetFramework="net462" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="7.0.0" targetFramework="net462" />
<package id="NLua" version="1.6.3" targetFramework="net462" />
<package id="System.Buffers" version="4.5.1" targetFramework="net462" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net462" />
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net462" />
<package id="System.Memory" version="4.5.5" targetFramework="net462" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />
<package id="System.Runtime" version="4.3.0" targetFramework="net462" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net462" />
<package id="System.Runtime.InteropServices" version="4.3.0" targetFramework="net462" />
<package id="System.Text.Encodings.Web" version="7.0.0" targetFramework="net462" />
<package id="System.Text.Json" version="7.0.3" targetFramework="net462" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
</packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment