⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 datastruct.cs

📁 本代码是为了应付人工智能的实验而编写的
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;

namespace Eight_Num_Fengart
{
    /// <summary>
    /// 空格移动的方向
    /// </summary>
    enum Direction
    {
        None,
        Up,
        Left,
        Right,
        Down
    }

    /// <summary>
    /// 解答
    /// </summary>
    enum Answer
    {
        /// <summary>
        /// 不存在解答
        /// </summary>
        NotExist,
        /// <summary>
        /// 存在解答
        /// </summary>
        Exist,
        /// <summary>
        /// 在当前指定的搜索深度内不存在解答(需要扩大深度)
        /// </summary>
        NotExistInDepth
    }

    /// <summary>
    /// 局面状态信息
    /// </summary>
    class StateMsg
    {
        private int depth;
        private Direction dir;
        public int Depth
        {
            get { return depth; }
        }
        public Direction Dir
        {
            get { return dir; }
        }

        public StateMsg(int depth, Direction dir)
        {
            this.depth = depth;
            this.dir = dir;
        }
    }

    /// <summary>
    /// 局面状态
    /// </summary>
    class State : StateMsg
    {
        private long code;

        /// <summary>
        /// 棋盘的编码
        /// </summary>
        public long Code
        {
            get { return code; }
            set { code = value; }
        }

        public State(long code, int depth, Direction dir)
            : base(depth, dir)
        {
            this.code = code;
        }
    }


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -