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); }
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); }
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); }
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; }
static long GetMaxHeight(Stack <HeightInfo> stack, long max, int pos) { HeightInfo heightInfoTop = stack.Pop(); return(Math.Max(max, heightInfoTop.Height * (pos - heightInfoTop.Pos))); }