Example #1
0
        TileFloor GetFloor(bool isSquare, int stX, int stZ, MapTips mapTips3)
        {
            //真上からブロックにぶつかるまで探す
            int           baseY     = -1;
            EnumShapeType baseShape = 0;
            int           basePal   = 0;
            bool          isFind    = false;

            for (int y = 0; y < mapTips3.mapSizeY; ++y)
            {
                int           revY  = (mapTips3.mapSizeY - y - 1);
                Vector3Int    pos   = new Vector3Int(stX, revY, stZ);
                EnumShapeType shape = mapTips3.GetShape(pos);
                int           pal   = mapTips3.GetEvent(pos);
                if (shape == 0)
                {
                    continue;             //空チップ
                }
                if (isSquare)
                {
                    if (IsTriFloor(shape))
                    {
                        continue;
                    }
                }
                else
                {
                    if (!IsTriFloor(shape))
                    {
                        continue;
                    }
                }

                baseY     = revY + 1;
                baseShape = shape;
                basePal   = pal;
                isFind    = true;
                break;
            }

            if (isFind)
            {
                TileFloor res = new TileFloor(baseShape, basePal, baseY, stX, stZ);
                return(res);
            }
            else
            {
                return(null);
            }
        }
Example #2
0
        //床
        List <TileFloor> SearchFloor(MapTips mapTips3)
        {
            List <TileFloor> floorList = new List <TileFloor>();

            for (int x = 0; x < mapTips3.mapSizeX; ++x)
            {
                for (int z = 0; z < mapTips3.mapSizeZ; ++z)
                {
                    //int index = (x + (mapSizeX * z));
                    TileFloor sqFloor = GetFloor(true, x, z, mapTips3);
                    if (sqFloor != null)
                    {
                        floorList.Add(sqFloor);
                    }

                    TileFloor triFloor = GetFloor(false, x, z, mapTips3);
                    if (triFloor != null)
                    {
                        floorList.Add(triFloor);
                    }
                }
            }
            return(floorList);
        }