Struct SerializableGridTopologyMetrics
- Namespace
- GridForge.Configuration
Unity-serializable authoring data for GridTopologyMetrics.
[Serializable]
public struct SerializableGridTopologyMetrics
- Inherited Members
Properties
DefaultHex
Gets unit pointy-top hex-prism metrics.
public static SerializableGridTopologyMetrics DefaultHex { get; }
Property Value
DefaultRectangular
Gets unit rectangular-prism metrics.
public static SerializableGridTopologyMetrics DefaultRectangular { get; }
Property Value
HexLayerHeight
Gets the hexagonal layer height.
public readonly Fixed64 HexLayerHeight { get; }
Property Value
HexOrientation
Gets the hexagonal cell orientation.
public readonly HexOrientation HexOrientation { get; }
Property Value
HexRadius
Gets the hexagonal cell radius.
public readonly Fixed64 HexRadius { get; }
Property Value
RectangularCellLength
Gets the rectangular cell length.
public readonly Fixed64 RectangularCellLength { get; }
Property Value
RectangularCellWidth
Gets the rectangular cell width.
public readonly Fixed64 RectangularCellWidth { get; }
Property Value
RectangularLayerHeight
Gets the rectangular layer height.
public readonly Fixed64 RectangularLayerHeight { get; }
Property Value
Methods
FromGridTopologyMetrics(GridTopologyKind, GridTopologyMetrics)
Creates serializable metrics from runtime topology metrics.
public static SerializableGridTopologyMetrics FromGridTopologyMetrics(GridTopologyKind topologyKind, GridTopologyMetrics metrics)
Parameters
topologyKindGridTopologyKindThe topology that determines which metrics are copied.
metricsGridTopologyMetricsThe runtime metrics.
Returns
- SerializableGridTopologyMetrics
The serializable metrics.
Hex(Fixed64, Fixed64, HexOrientation)
Creates hex-prism topology metrics.
public static SerializableGridTopologyMetrics Hex(Fixed64 radius, Fixed64 layerHeight, HexOrientation orientation)
Parameters
radiusFixed64The hexagonal cell radius.
layerHeightFixed64The layer height.
orientationHexOrientationThe hexagonal cell orientation.
Returns
- SerializableGridTopologyMetrics
The serializable metrics.
Rectangular(Fixed64, Fixed64, Fixed64)
Creates rectangular-prism topology metrics.
public static SerializableGridTopologyMetrics Rectangular(Fixed64 cellWidth, Fixed64 layerHeight, Fixed64 cellLength)
Parameters
cellWidthFixed64The cell width.
layerHeightFixed64The layer height.
cellLengthFixed64The cell length.
Returns
- SerializableGridTopologyMetrics
The serializable metrics.
TryToGridTopologyMetrics(GridTopologyKind, out GridTopologyMetrics, out string)
Validates and converts these values to runtime topology metrics.
public readonly bool TryToGridTopologyMetrics(GridTopologyKind topologyKind, out GridTopologyMetrics metrics, out string failureReason)
Parameters
topologyKindGridTopologyKindThe topology to convert.
metricsGridTopologyMetricsReceives the runtime metrics.
failureReasonstringReceives the validation failure reason.