AI/SecondLayer.cs

(开头部分) 5KB

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

using Cube.Data;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CubeForm.AI
{
    class SecondLayer : IPattenMatch
    {
        Cube.Data.Cube cube;
        PattenManager patten;
        List<PositionVector> AvailablePositions = new List<PositionVector>
        {
            new PositionVector(1,0,1),
            new PositionVector(0,-1,1),
            new PositionVector(-1,0,1),
            new PositionVector(0,1,1)
        };

        public event PattenMatchedDelegate PattenMatched;

        public SecondLayer(Cube.Data.Cube cube)
        {
            this.cube = cube;
            patten = new PattenManager(cube);
        }
        public void Invoke()
        {
            while (TrySetAnAvailableBlock())
            {
                RotateCubeToRightCase();
                var second_layer_case = JudgeCase();
                switch (second_layer_case)
                {
                    case SecondLayerCase.Case1:
                        DoPatten1();
                        break;
                    case SecondLayerCase.Case2:
                        DoPatten2();
                        break;
                }
                Debug.WriteLine("A SideBlock Done.\n");
            }
            PattenMatched?.Invoke(patten.GetRecord());
        }

        /// <summary>
        /// 执行公式一
        /// </summary>
        private void DoPatten1()
        {
            patten.R();patten.U();patten.R();patten.U();patten.R();
            patten._U();patten._R();patten._U();patten._R();
        }
        /// <summary>
        /// 执行公式二
        /// </summary>
后面还有 99 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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