Exemplo n.º 1
0
        public void Test_SubGrid_GetOTGLeafSubGridCellIndex()
        {
            SubGridTree tree = new SubGridTree(SubGridTreeConsts.SubGridTreeLevels, 1.0, new SubGridFactory <NodeSubGrid, LeafSubGrid>());

            var subGrid = new SubGrid(tree, null, 6);

            subGrid.GetOTGLeafSubGridCellIndex(0, 0, out byte subGridX, out byte subGridY);
            subGridX.Should().Be(0);
            subGridY.Should().Be(0);

            subGrid.GetOTGLeafSubGridCellIndex(SubGridTreeConsts.SubGridTreeDimensionMinus1, SubGridTreeConsts.SubGridTreeDimensionMinus1, out subGridX, out subGridY);
            subGridX.Should().Be(SubGridTreeConsts.SubGridTreeDimensionMinus1);
            subGridY.Should().Be(SubGridTreeConsts.SubGridTreeDimensionMinus1);

            subGrid.GetOTGLeafSubGridCellIndex(SubGridTreeConsts.SubGridTreeDimension, SubGridTreeConsts.SubGridTreeDimension, out subGridX, out subGridY);
            subGridX.Should().Be(0);
            subGridY.Should().Be(0);
        }