Table of Contents

Interface ITerrain

Namespace
AlphaFramework.World.Terrains
Assembly
AlphaFramework.World.dll

A common base for all ITerrain types.

public interface ITerrain
Extension Methods

Properties

Center

The world coordinates of the center of the terrain.

[Browsable(false)]
Vector2 Center { get; }

Property Value

Vector2

DataLoaded

Was the minimum necessary data for the terrain (HeightMap and TextureMap) loaded already?

[Browsable(false)]
bool DataLoaded { get; }

Property Value

bool

HeightMap

Direct access to the internal height-map array. Handle with care; clone when necessary!

[Browsable(false)]
ByteGrid? HeightMap { get; set; }

Property Value

ByteGrid

Remarks

Is not serialized/stored, is loaded by LoadHeightMap(Stream).

Exceptions

InvalidOperationException

The height-map size is incorrect.

OcclusionIntervalMap

Direct access to the internal occlusion interval map array. Handle with care; clone when necessary!

[Browsable(false)]
ByteVector4Grid? OcclusionIntervalMap { get; set; }

Property Value

ByteVector4Grid

Remarks

Is not serialized/stored, is loaded by LoadOcclusionIntervalMap(Stream).

Exceptions

InvalidOperationException

The size is incorrect.

OcclusionIntervalMapOutdated

Indicates that the data stored in OcclusionIntervalMap is outdated and should be recalculated using OcclusionIntervalMapGenerator.

bool OcclusionIntervalMapOutdated { get; set; }

Property Value

bool

Size

The size of the terrain.

TerrainSize Size { get; set; }

Property Value

TerrainSize

TextureMap

Direct access to the internal height-map array. Handle with care; clone when necessary!

[Browsable(false)]
NibbleGrid? TextureMap { get; set; }

Property Value

NibbleGrid

Remarks

Is not serialized/stored, is loaded by LoadTextureMap(string).

Exceptions

InvalidOperationException

The height-map size is incorrect.

Methods

LoadHeightMap(Stream)

Loads data for HeightMap from a stream.

[LuaHide]
void LoadHeightMap(Stream stream)

Parameters

stream Stream

The stream to read the height-map from.

Exceptions

IOException

The height-map size is incorrect.

LoadHeightMap(string)

Loads data for HeightMap from a file.

void LoadHeightMap(string path)

Parameters

path string

The path of the PNG file to load the height-map from.

Exceptions

IOException

The texture-map size is incorrect.

LoadOcclusionIntervalMap(Stream)

Loads data for OcclusionIntervalMap from a stream.

[LuaHide]
void LoadOcclusionIntervalMap(Stream stream)

Parameters

stream Stream

The stream to read the occlusion interval map from.

Exceptions

IOException

The occlusion interval map size is incorrect.

LoadOcclusionIntervalMap(string)

Loads data for OcclusionIntervalMap from a file.

void LoadOcclusionIntervalMap(string path)

Parameters

path string

The path of the PNG file to load the occlusion interval map from.

Exceptions

IOException

The texture-map size is incorrect.

LoadTextureMap(Stream)

Loads data for TextureMap from a stream.

[LuaHide]
void LoadTextureMap(Stream stream)

Parameters

stream Stream

The stream to read the texture-map from.

Exceptions

IOException

The texture-map size is incorrect.

LoadTextureMap(string)

Loads data for TextureMap from a file.

void LoadTextureMap(string path)

Parameters

path string

The path of the PNG file to load the texture-map from.

Exceptions

IOException

The texture-map size is incorrect.

MarkUntraversableSlopes(bool[,], int)

Marks untraversable slopes in a pathfinding "obstruction map".

[LuaHide]
void MarkUntraversableSlopes(bool[,] obstructionMap, int maxTraversableSlope)

Parameters

obstructionMap bool[,]

The existing pathfinding "obstruction map" to mark the untraversable slopes in.

maxTraversableSlope int

The maximum slope to consider traversable.