示例#1
0
        TileWall GetWall(bool isSquare, int stX, int stY, MapTips mapTips3)
        {
            //手前からブロックにぶつかるまで探す
            int           baseZ     = -1;
            EnumShapeType baseShape = EnumShapeType.Empty;
            int           basePal   = 0;
            bool          isFind    = false;

            for (int z = 0; z < mapTips3.mapSizeZ; ++z)
            {
                Vector3Int    pos   = new Vector3Int(stX, stY, z);
                EnumShapeType shape = mapTips3.GetShape(pos);
                int           pal   = mapTips3.GetEvent(pos);
                if (shape == 0)
                {
                    continue;             //空チップ
                }
                if (isSquare)
                {
                    if (IsTriWall(shape))
                    {
                        continue;
                    }
                }
                else
                {
                    if (!IsTriWall(shape))
                    {
                        continue;
                    }
                }

                baseZ     = z;
                baseShape = shape;
                basePal   = pal;
                isFind    = true;
                break;
            }

            if (isFind)
            {
                TileWall res = new TileWall(baseShape, basePal, baseZ, stX, stY);
                return(res);
            }
            else
            {
                return(null);
            }
        }
示例#2
0
        //壁
        List <TileWall> SearchWall(MapTips mapTips3)
        {
            List <TileWall> wallList = new List <TileWall>();

            for (int x = 0; x < mapTips3.mapSizeX; ++x)
            {
                for (int y = 0; y < mapTips3.mapSizeY; ++y)
                {
                    //int index = (x + (mapSizeX * y));
                    TileWall sqWall = GetWall(true, x, y, mapTips3);
                    if (sqWall != null)
                    {
                        wallList.Add(sqWall);
                    }

                    TileWall triWall = GetWall(false, x, y, mapTips3);
                    if (triWall != null)
                    {
                        wallList.Add(triWall);
                    }
                }
            }
            return(wallList);
        }