Struct TerrainSelection
Represents a tile selection of the tycoon tile terrain. This is used with the included tools and previewers.
Namespace: TycoonTerrain.Core
Assembly: TycoonTerrainAssembly.dll
Syntax
public struct TerrainSelection
Fields
Terrain
The terrain that this selection refers to.
Declaration
public TycoonTileMap Terrain
Field Value
Type | Description |
---|---|
TycoonTileMap | The selected map instance. |
Properties
Bounds
Gets the selected bounds that is within the terrain area.
Declaration
public IntBound Bounds { get; }
Property Value
Type | Description |
---|---|
IntBound | The bounds. |
CenterPosition
Gets the center position.
Declaration
public float2 CenterPosition { get; }
Property Value
Type | Description |
---|---|
Unity.Mathematics.float2 | The center position. |
HasSelection
Whether this selection is valid.
Declaration
public bool HasSelection { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
IsSelectionWithinTerrainArea
Indicates whether the terrain selection is completely within the terrain bounds. False otherwise.
Declaration
public bool IsSelectionWithinTerrainArea { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
IsSingleCornerSelection
Gets a value indicating whether this selection is a single tile corner.
Declaration
public bool IsSingleCornerSelection { get; }
Property Value
Type | Description |
---|---|
Boolean |
|
Size
The selection size.
Declaration
public int2 Size { get; }
Property Value
Type | Description |
---|---|
Unity.Mathematics.int2 | The selection size. |
TileCorner
Gets the selected tile corner. Should only be called when IsSingleCornerSelection is true.
Declaration
public TileCorner TileCorner { get; }
Property Value
Type | Description |
---|---|
TileCorner | The tile corner. |
Tiles
Enumerates through the tiles within the selection.
Declaration
public IEnumerable<TileHandle> Tiles { get; }
Property Value
Type | Description |
---|---|
IEnumerable<TileHandle> | The tiles within this selection. |
UnconstrainedBounds
Gets the selected bounds. These bounds may be located (partially) outside the valid terrain area.
Declaration
public IntBound UnconstrainedBounds { get; }
Property Value
Type | Description |
---|---|
IntBound | The unconstrained bounds. |
Methods
Clear()
Clears the selection.
Declaration
public void Clear()
SelectTileBounds(IntBound)
Sets this terrain selection a rectangular selection of multiple tiles.
Declaration
public void SelectTileBounds(IntBound bounds)
Parameters
Type | Name | Description |
---|---|---|
IntBound | bounds | The bounds of the tiles that should be selected. |
SelectTileCorner(TileHandle, CornerIndex)
Sets this terrain selection to a single tile corner.
Declaration
public void SelectTileCorner(TileHandle tile, CornerIndex tileCorner)
Parameters
Type | Name | Description |
---|---|---|
TileHandle | tile | The tile of which the corner will be selected. |
CornerIndex | tileCorner | The corner of the tile that will be selected. |