• Manual
  • Scripting API
  • Asset Store
  • TycoonTerrain.Core
  • IntBound
Search Results for

    Show / Hide Table of Contents
    • TycoonTerrain.Components
      • TycoonTileRendererBase
    • TycoonTerrain.Core
      • BoundsContainer
      • BoundsReservationRegister
      • CallbackHandle
      • CallbacksRegister
      • CardinalDirection
      • ChunkSet
      • ConstructableDefinition
      • CornerIndex
      • Extensions
      • IChunkListener
      • IntBound
      • LandTile
      • OnBoundsChangeCallback
      • PlacementValidResult
      • SurfaceOverlayMesh
      • TerrainGrid
      • TerrainModifiedEvent
      • TerrainSelection
      • TerrainTypeCollectionAsset
      • TerrainTypeDefinition
      • TerrainTypeTable
      • TileCorner
      • TileHandle
      • TilePosition
      • TileType
      • TycoonTileMap
      • TycoonTileRaycastHit
    • TycoonTerrain.Core.Generation
      • TerrainGenerationJob
    • TycoonTerrain.Core.Rendering
      • ChunkMesh
      • IMesh
      • NativeMeshData
      • RenderTerrainCliffChunkJob
      • RenderTerrainSurfaceChunkJob
      • RenderWaterChunkJob
      • RenderWaterCliffChunkJob
      • SubMeshTriangle
    • TycoonTerrain.Core.TerrainOperations
      • ClearWaterBodyOperation
      • CopyHeightMapOperation
      • CreateWaterBodyFloodOperation
      • DecreaseHeightCliffOperation
      • DecreaseHeightCorner
      • DecreaseHeightSmoothConnectedOperation
      • GetTilesInWaterBody
      • IncreaseHeightCliffOperation
      • IncreaseHeightCorner
      • IncreaseHeightSmoothConnectedOperation
      • ITerrainOperation
      • MaxHeightSmooth
      • OperationContext
      • OperationResult
      • SetHeightOperation
      • SetTileTypeInBoundsOperation
      • SetWaterLevelOperation
    • TycoonTerrain.Previewers
      • BuildingToolPreviewer
      • PreviewMeshes
      • TerrainPainterPreviewer
      • TerrainSelectionPreviewer
      • ToolPreviewerBase<T>
    • TycoonTerrain.Tools
      • BuildingTool
      • PainterTool
      • SceneryTool
      • SelectionToolBase
      • SnappingMode
      • TerraformingTool
      • ToolBase
      • WaterTool

    Struct IntBound

    An IntBound defines a horizontal rectangle of tile positions. It is analogous to the UnityEngine.Bounds class for tile positions.

    Namespace: TycoonTerrain.Core
    Assembly: TycoonTerrainAssembly.dll
    Syntax
    public struct IntBound : IEquatable<IntBound>

    Constructors

    IntBound(int2, int2)

    Creates a new instance of IntBound where min is the minimum position in both directions and max is the maximum position in both directions.

    Declaration
    public IntBound(int2 min, int2 max)
    Parameters
    Type Name Description
    Unity.Mathematics.int2 min

    The minimum position in both directions (inclusive).

    Unity.Mathematics.int2 max

    The maximum position in both directions (inclusive).

    Properties

    Invalid

    Gets an invalid bounds.

    Declaration
    public static IntBound Invalid { get; }
    Property Value
    Type Description
    IntBound

    An invalid bounds.

    IsValid

    Returns true if this instance is valid.

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    Boolean

    true if this instance is valid; otherwise, false.

    Max

    The maximum position in both directions (inclusive).

    Declaration
    public int2 Max { get; }
    Property Value
    Type Description
    Unity.Mathematics.int2

    The maximum position in both directions (inclusive).

    Min

    The minimum position in both directions (inclusive).

    Declaration
    public int2 Min { get; }
    Property Value
    Type Description
    Unity.Mathematics.int2

    The minimum position in both directions (inclusive).

    PositionsInBounds

    Returns an enumeration of all the positions that lie within this bounds.

    Declaration
    public IEnumerable<int2> PositionsInBounds { get; }
    Property Value
    Type Description
    IEnumerable<Unity.Mathematics.int2>

    Each position within the bounds.

    Size

    The size in both directions.

    Declaration
    public int2 Size { get; }
    Property Value
    Type Description
    Unity.Mathematics.int2

    The size in both directions.

    Methods

    Contains(IntBound)

    Returns whether the given bounds is contained within the bounds.

    Declaration
    public bool Contains(IntBound bounds)
    Parameters
    Type Name Description
    IntBound bounds

    The bounds to be checked for.

    Returns
    Type Description
    Boolean

    true if bounds is within the bounds; otherwise, false.

    Contains(int2)

    Returns whether the given position is contained within the bounds.

    Declaration
    public bool Contains(int2 pos)
    Parameters
    Type Name Description
    Unity.Mathematics.int2 pos

    The position.

    Returns
    Type Description
    Boolean

    true if pos is within the bounds; otherwise, false.

    Distance(int2)

    Returns the closest distance between the given position and this bounds. Returns 0 if position lies within the bounds.

    Declaration
    public int Distance(int2 position)
    Parameters
    Type Name Description
    Unity.Mathematics.int2 position

    The position to check against.

    Returns
    Type Description
    Int32

    The closest distance between position and this bounds in manhatten distance.

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)

    Equals(IntBound)

    Declaration
    public bool Equals(IntBound other)
    Parameters
    Type Name Description
    IntBound other
    Returns
    Type Description
    Boolean

    Expand(CardinalDirection, Int32)

    Expands the bounds in the given direction by the given number of units.

    Declaration
    public IntBound Expand(CardinalDirection direction, int amount)
    Parameters
    Type Name Description
    CardinalDirection direction

    The direction to expand the bounds to.

    Int32 amount

    The number of units to expand the bounds by.

    Returns
    Type Description
    IntBound

    The bounds expanded by amount in direction.

    Expand(int2)

    Expands the bounds in all directions by the given number of units.

    Declaration
    public IntBound Expand(int2 expansion)
    Parameters
    Type Name Description
    Unity.Mathematics.int2 expansion

    The number of units to expand in each direction.

    Returns
    Type Description
    IntBound

    The bounds expanded by expansion in all directions.

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()

    Intersection(IntBound)

    Returns the intersection between the given bounds and this bounds.

    Declaration
    public IntBound Intersection(IntBound other)
    Parameters
    Type Name Description
    IntBound other

    The other bounds.

    Returns
    Type Description
    IntBound

    The intersection between the given bounds and this bounds instance.

    Intersects(IntBound)

    Returns whether the given bounds intersect with this bounds. True if they intersect, false otherwise.

    Declaration
    public bool Intersects(IntBound bounds)
    Parameters
    Type Name Description
    IntBound bounds

    The bounds to check against.

    Returns
    Type Description
    Boolean

    true if bounds intersects with the bounds; otherwise, false.

    Operators

    Equality(IntBound, IntBound)

    Declaration
    public static bool operator ==(IntBound left, IntBound right)
    Parameters
    Type Name Description
    IntBound left
    IntBound right
    Returns
    Type Description
    Boolean

    Inequality(IntBound, IntBound)

    Declaration
    public static bool operator !=(IntBound left, IntBound right)
    Parameters
    Type Name Description
    IntBound left
    IntBound right
    Returns
    Type Description
    Boolean

    See Also

    IEquatable<T>
    In This Article
    • Constructors
      • IntBound(int2, int2)
    • Properties
      • Invalid
      • IsValid
      • Max
      • Min
      • PositionsInBounds
      • Size
    • Methods
      • Contains(IntBound)
      • Contains(int2)
      • Distance(int2)
      • Equals(Object)
      • Equals(IntBound)
      • Expand(CardinalDirection, Int32)
      • Expand(int2)
      • GetHashCode()
      • Intersection(IntBound)
      • Intersects(IntBound)
    • Operators
      • Equality(IntBound, IntBound)
      • Inequality(IntBound, IntBound)
    • See Also
    Back to top Tycoon Tile documentation