CustomClass/Qipu.cs

(开头部分) 15KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections;
using Newtonsoft.Json;
using System.Windows.Controls;
using System.Drawing;
using System.ComponentModel;

namespace Chess.CustomClass
{
    public static class Qipu  // 棋谱类
    {

        public static ObservableCollection<ContractQPClass> QiPuList = new(); // 棋谱记录列表
        public static ContractQPClass ContractQiPu = new(); // 收缩树
        /// <summary>
        /// 着法类
        /// </summary>
        public class StepCode
        {
            #region 棋谱数据
            public int QiZi { get; set; } // 棋子编号
            public int X0 { get; set; } // 移动前位置
            public int Y0 { get; set; }
            public int X1 { get; set; } // 移动后位置
            public int Y1 { get; set; }
            public int DieQz { get; set; } // 移动后杀死的棋子
            public string UcciStep;
            public StepCode(int qiZi, int x0, int y0, int x1, int y1, int dieQz)
            {
                QiZi = qiZi;
                X0 = x0;
                Y0 = y0;
                X1 = x1;
                Y1 = y1;
                DieQz = dieQz;
                string cols = "abcdefghi";
                string rows = "9876543210";
                UcciStep = string.Concat(cols.AsSpan(x0, 1), rows.AsSpan(y0, 1), cols.AsSpan(x1, 1), rows.AsSpan(y1, 1));
            }
            /// <summary>
            /// 执行着法
            /// </summary>
            public void LunchStep()
            {
                if (QiZi is > -1 and < 32)
                {
                    GlobalValue.QiZiMoveTo(QiZi, X1, Y1, true);
                }
            }
            #endregion
        }
        /// <summary>
        /// 棋谱基类
        /// 包含棋谱步数、走棋数字代码(用于数据库存储)、走棋中文代码(用于列表或树显示)等
        /// </summary>
        public class QPBase
        {
            #region 棋谱数字代码、中文代码、备注
后面还有 352 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。