public Biome GetBiome(Vector3f worldPosition)
        {
            Vector3f   chunkSpace1 = WorldToChunkSpace(worldPosition);
            HeightInfo closest     = HmWithCoords((int)chunkSpace1.x, (int)chunkSpace1.z);

            if (closest != null)
            {
                chunkSpace1.x -= closest.position.x;
                chunkSpace1.z -= closest.position.y;
                chunkSpace1.MultiplyStore((chunkSize - 1));

                return(((SimplexTerrainChunkNode)closest.chunk).GetBiome(chunkSpace1));
            }
            return(null);
        }
Beispiel #2
0
        HeightInfo GetHeightInfo(Dev2DataGrid dataGrid)
        {
            var info = new HeightInfo();

            if (dataGrid.Items.Count > 0)
            {
                var dataGridRow = dataGrid.GetRow(0);
                if (dataGridRow != null)
                {
                    info.Row = dataGridRow.ActualHeight;
                }

                var dataGridColumnHeadersPresenter = InputsDataGrid.GetColumnHeadersPresenter();
                if (dataGridColumnHeadersPresenter != null)
                {
                    info.Header = dataGridColumnHeadersPresenter.ActualHeight;
                }
            }
            return(info);
        }
Beispiel #3
0
        private static SquarePoint GetClosetSqare(SquareInformation pInfo, HeightInfo Height, bool pUserOverride)
        {
            double      Closest      = pInfo.Point.GetDistance;
            SquarePoint squarePoint1 = pInfo.Point;
            double      state        = Height.GetState(pInfo.Point.X, pInfo.Point.Y);

            for (int val = 0; val < 8; val++)
            {
                SquarePoint squarePoint2 = pInfo.Pos(val);
                if ((squarePoint2.AllowWalkthrough && squarePoint2.CanWalk && ((Height.GetState(squarePoint2.X, squarePoint2.Y) - state < 2)) || pUserOverride))
                {
                    double getDistance = squarePoint2.GetDistance;
                    if (Closest > getDistance)
                    {
                        Closest      = getDistance;
                        squarePoint1 = squarePoint2;
                    }
                }
            }

            return(squarePoint1);
        }
Beispiel #4
0
        HeightInfo GetHeightInfo(Dev2DataGrid dataGrid)
        {
            var info = new HeightInfo();
            if(dataGrid.Items.Count > 0)
            {
                var dataGridRow = dataGrid.GetRow(0);
                if(dataGridRow != null)
                {
                    info.Row = dataGridRow.ActualHeight;
                }

                var dataGridColumnHeadersPresenter = InputsDataGrid.GetColumnHeadersPresenter();
                if(dataGridColumnHeadersPresenter != null)
                {
                    info.Header = dataGridColumnHeadersPresenter.ActualHeight;
                }
            }
            return info;
        }
Beispiel #5
0
    static long GetMaxHeight(Stack <HeightInfo> stack, long max, int pos)
    {
        HeightInfo heightInfoTop = stack.Pop();

        return(Math.Max(max, heightInfoTop.Height * (pos - heightInfoTop.Pos)));
    }