• Manual
  • Scripting API
  • Asset Store
  • TycoonTerrain.Core
  • CardinalDirection
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 CardinalDirection

    Represents a north/east/south/west direction. North is the positive z axis. East is positive x axis.

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

    Constructors

    CardinalDirection(int2)

    Returns a direction from an offset vector.

    Declaration
    public CardinalDirection(int2 vector)
    Parameters
    Type Name Description
    Unity.Mathematics.int2 vector

    The offset vector.

    Properties

    All

    Enumerates every direction in the order north, east, south, west.

    Declaration
    public static IEnumerable<CardinalDirection> All { get; }
    Property Value
    Type Description
    IEnumerable<CardinalDirection>

    Every direction in the order north, east, south, west.

    East

    Gets the east direction.

    Declaration
    public static CardinalDirection East { get; }
    Property Value
    Type Description
    CardinalDirection

    The east direction.

    Inverse

    Returns the opposite direction.

    Declaration
    public CardinalDirection Inverse { get; }
    Property Value
    Type Description
    CardinalDirection

    The opposite direction fo the current direction.

    Examples

    North.Inverse returns South.

    North

    Gets the north direction.

    Declaration
    public static CardinalDirection North { get; }
    Property Value
    Type Description
    CardinalDirection

    The north direction.

    RotateLeft

    Returns the direction when one would turn 90 degrees to the left from the current direction.

    Declaration
    public CardinalDirection RotateLeft { get; }
    Property Value
    Type Description
    CardinalDirection

    The direction when one would turn 90 degrees to the left from the current direction.

    Examples

    North.RotateLeft returns West.

    RotateRight

    Returns the direction when one would turn 90 degrees to the right from the current direction.

    Declaration
    public CardinalDirection RotateRight { get; }
    Property Value
    Type Description
    CardinalDirection

    The direction when one would turn 90 degrees to the right from the current direction.

    Examples

    North.RotateRight returns East.

    South

    Gets the south direction.

    Declaration
    public static CardinalDirection South { get; }
    Property Value
    Type Description
    CardinalDirection

    The south direction.

    West

    Gets the west direction.

    Declaration
    public static CardinalDirection West { get; }
    Property Value
    Type Description
    CardinalDirection

    The west direction.

    Methods

    Equals(Object)

    Determines whether the specified Object, is equal to this instance.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The Object to compare with this instance.

    Returns
    Type Description
    Boolean

    true if the specified Object is equal to this instance; otherwise, false.

    Overrides
    ValueType.Equals(Object)

    Equals(CardinalDirection)

    Equalses the specified other.

    Declaration
    public bool Equals(CardinalDirection other)
    Parameters
    Type Name Description
    CardinalDirection other

    The other.

    Returns
    Type Description
    Boolean

    GetDirectionFromCorner(CornerIndex, Boolean)

    Returns a direction from the point of view of a corner index, facing outwards.

    Declaration
    public static CardinalDirection GetDirectionFromCorner(CornerIndex corner, bool left)
    Parameters
    Type Name Description
    CornerIndex corner

    The corner index.

    Boolean left

    Whether to return the left or right direction.

    Returns
    Type Description
    CardinalDirection
    Examples

    GetDirectionFromCorner(CornerIndex.NorthEast, true) returns North.

    GetDirectionFromCorner(CornerIndex.NorthEast, false) returns East.

    GetHashCode()

    Returns a hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Converts to string.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A String that represents this instance.

    Overrides
    ValueType.ToString()

    ToVector()

    Returns the offset in tile positions that is represented by the direction.

    Declaration
    public int2 ToVector()
    Returns
    Type Description
    Unity.Mathematics.int2

    Operators

    Equality(CardinalDirection, CardinalDirection)

    Implements the operator ==.

    Declaration
    public static bool operator ==(CardinalDirection left, CardinalDirection right)
    Parameters
    Type Name Description
    CardinalDirection left

    The left.

    CardinalDirection right

    The right.

    Returns
    Type Description
    Boolean

    The result of the operator.

    Inequality(CardinalDirection, CardinalDirection)

    Implements the operator !=.

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

    The left.

    CardinalDirection right

    The right.

    Returns
    Type Description
    Boolean

    The result of the operator.

    In This Article
    • Constructors
      • CardinalDirection(int2)
    • Properties
      • All
      • East
      • Inverse
      • North
      • RotateLeft
      • RotateRight
      • South
      • West
    • Methods
      • Equals(Object)
      • Equals(CardinalDirection)
      • GetDirectionFromCorner(CornerIndex, Boolean)
      • GetHashCode()
      • ToString()
      • ToVector()
    • Operators
      • Equality(CardinalDirection, CardinalDirection)
      • Inequality(CardinalDirection, CardinalDirection)
    Back to top Tycoon Tile documentation