本文整理汇总了C#中Rect.IntXMin方法的典型用法代码示例。如果您正苦于以下问题:C# Rect.IntXMin方法的具体用法?C# Rect.IntXMin怎么用?C# Rect.IntXMin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect
的用法示例。
在下文中一共展示了Rect.IntXMin方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RectToSimpleRect
public static SimpleRect RectToSimpleRect(Rect rect)
{
return new SimpleRect(rect.IntXMin(), rect.IntYMin(), rect.IntWidth(), rect.IntHeight());
}
示例2: FillMatchingTilesInRect
public void FillMatchingTilesInRect(Rect rect, TileType typeToFill, TileType match)
{
if (_grid == null)
_grid = new TileType[this.Width, this.Height];
for (int x = rect.IntXMin(); x < rect.IntXMax(); ++x)
{
for (int y = rect.IntYMin(); y < rect.IntYMax(); ++y)
{
if ((_grid[x, y] | match) == match)
_grid[x, y] = typeToFill;
}
}
}
示例3: ListOfCoordinatesOfType
public List<Coordinate> ListOfCoordinatesOfType(Rect rect, TileType type, bool allowWrapping = false)
{
List<Coordinate> coords = new List<Coordinate>();
for (int x = rect.IntXMin(); x < rect.IntXMax(); ++x)
{
for (int y = rect.IntYMin(); y < rect.IntYMax(); ++y)
{
if (_grid[x, y] == type)
{
Coordinate? possibleCoord = this.ConstructValidCoordinate(x, y, allowWrapping);
if (possibleCoord.HasValue)
coords.Add(possibleCoord.Value);
}
}
}
return coords;
}
示例4: CopyOfGridRect
public LevelGenMap.TileType[,] CopyOfGridRect(Rect rect)
{
LevelGenMap.TileType[,] copy = new LevelGenMap.TileType[rect.IntWidth(), rect.IntHeight()];
for (int x = rect.IntXMin(); x < rect.IntXMax(); ++x)
{
for (int y = rect.IntYMin(); y < rect.IntYMax(); ++y)
{
copy[x - rect.IntXMin(), y - rect.IntYMin()] = _grid[x, y];
}
}
return copy;
}
示例5: CoordinatesInRect
public List<Coordinate> CoordinatesInRect(Rect rect, bool allowsWrapping = false)
{
List<Coordinate> coords = new List<Coordinate>();
for (int x = rect.IntXMin(); x < rect.IntXMax(); ++x)
{
for (int y = rect.IntYMin(); y < rect.IntYMax(); ++y)
{
Coordinate? coord = this.ConstructValidCoordinate(x, y, allowsWrapping);
if (coord.HasValue)
coords.Add(coord.Value);
}
}
return coords;
}
示例6: FillMatchingTilesWithChance
public void FillMatchingTilesWithChance(Rect rect, TileType typeToFill, TileType match, float chance)
{
if (_grid == null)
_grid = new TileType[this.Width, this.Height];
for (int x = rect.IntXMin(); x < rect.IntXMax(); ++x)
{
for (int y = rect.IntYMin(); y < rect.IntYMax(); ++y)
{
if ((_grid[x, y] | match) == match && Random.Range(0.0f, 1.0f) <= chance)
_grid[x, y] = typeToFill;
}
}
}