Exemple #1
0
        /// <summary>
        /// 盤面の情報を基に着手可能手を列挙します
        /// </summary>
        /// <returns></returns>
        public ulong GetEnumMove(BoardClass bclass)
        {
            ulong moveBit;
            ulong bk, wh;
            uint count = 0;

            if (bclass.GetNowColor() == BoardClass.BLACK) 
            {
                bk = bclass.GetBlack();
                wh = bclass.GetWhite();
            }
            else 
            {
                bk = bclass.GetWhite();
                wh = bclass.GetBlack();
            }

            unsafe
            {
                moveBit = NativeMethods.KZ_GetEnumMove(bk, wh, &count);
            }

            return moveBit;
        }
Exemple #2
0
        public Form1()
        {
            boardclass = new BoardClass();

            cpuClass = new CpuClass[2];
            cpuClass[0] = new CpuClass(); // BLACK
            cpuClass[1] = new CpuClass(); // WHITE

            delegateObj = new SetMoveProperty(setMove);
            nodeCountDelegate = new SetNodeCountProperty(setNodeCount);
            cpuMessageDelegate = new SetCpuMessageProperty(setCpuMessage);
            setPVLineDelegate = new SetCpuMessageProperty(setPVLine);
            setMPCInfoDelegate = new SetCpuMessageProperty(setMPCInfo);
            hintDelegate = new DoHintProperty(doHintProcess);

            boardclass.InitBoard(COLOR_BLACK);

            InitializeComponent();
            comboBox1.SelectedIndex = 0;
            comboBox2.SelectedIndex = 3;

            // プレイヤー情報を初期化
            playerArray = new Player[2];
            playerArray[COLOR_BLACK] = new Player(Player.PLAYER_HUMAN, COLOR_BLACK);
            playerArray[COLOR_WHITE] = new Player(Player.PLAYER_CPU, COLOR_WHITE);

            // デフォルトプレイヤー
            nowPlayer = playerArray[COLOR_BLACK];
            if (nowColor == COLOR_BLACK)
            {
                label1.BackColor = Color.PowderBlue;
                label2.BackColor = Control.DefaultBackColor;
            }
            else
            {
                label2.BackColor = Color.PowderBlue;
                label1.BackColor = Control.DefaultBackColor;
            }

            // 探索時間表示用
            m_sw = new Stopwatch();

            // ヒント表示用
            m_hintList = new List<int[]>();

        }