C# Класс NetMud.Cartography.Cartographer

Methods for handling with the coordinate maps
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
FindCenterOfMap ( long map, int zIndex = -1 ) : IRoomData

Finds the central room of a given map

GenerateMapFromRoom ( IRoomData room, int radius, HashSet roomPool, bool shrink = false ) : long[,,]

Generate a room map starting in a room backing data with a radius around it

GetRoomInDirection ( IRoomData origin, MovementDirectionType direction ) : IRoomData

Gets a room in a direction if there is one based on the world map the room belongs to

GetSinglePlane ( long fullMap, int zIndex ) : ].long[

Render a 3d map down to 2d

GetZoneMap ( long fullMap, long zoneId, bool recenter = false ) : long[,,]

Isolates the main world map to just one zone

ShrinkMap ( long map ) : long[,,]

Shrinks a map matrix to its exact needed coordinate bounds

TakeSliceOfMap ( int>.Tuple xBounds, int>.Tuple yBounds, int>.Tuple zBounds, long map, bool shrink = false ) : long[,,]

Gives back the original map but with all rooms that fall outside of the indicated bounds removed

Приватные методы

Метод Описание
AddDirectionToMap ( long dataMap, MovementDirectionType transversalDirection, IRoomData origin, int diameter, int centerX, int centerY, int centerZ, HashSet roomPool ) : long[,,]
AddFullRoomToMap ( long dataMap, IRoomData origin, int diameter, int centerX, int centerY, int centerZ, HashSet roomPool ) : long[,,]
ShrinkMap ( long fullMap, int xLowest, int yLowest, int zLowest, int>.Tuple xBounds, int>.Tuple yBounds, int>.Tuple zBounds ) : long[,,]

Описание методов

FindCenterOfMap() публичный статический Метод

Finds the central room of a given map
public static FindCenterOfMap ( long map, int zIndex = -1 ) : IRoomData
map long the map x,y,z
zIndex int If > -1 we're looking for the x,y center of the single plane as opposed to the actual x,y,z center of the whole map
Результат IRoomData

GenerateMapFromRoom() публичный статический Метод

Generate a room map starting in a room backing data with a radius around it
public static GenerateMapFromRoom ( IRoomData room, int radius, HashSet roomPool, bool shrink = false ) : long[,,]
room IRoomData the starting room
radius int the radius of rooms to go out to. -1 means "generate the entire world"
roomPool HashSet
shrink bool
Результат long[,,]

GetRoomInDirection() публичный статический Метод

Gets a room in a direction if there is one based on the world map the room belongs to
public static GetRoomInDirection ( IRoomData origin, MovementDirectionType direction ) : IRoomData
origin IRoomData The room we're starting in
direction MovementDirectionType The direction we're moving in
Результат IRoomData

GetSinglePlane() публичный статический Метод

Render a 3d map down to 2d
public static GetSinglePlane ( long fullMap, int zIndex ) : ].long[
fullMap long
zIndex int
Результат ].long[

GetZoneMap() публичный статический Метод

Isolates the main world map to just one zone
public static GetZoneMap ( long fullMap, long zoneId, bool recenter = false ) : long[,,]
fullMap long the world map
zoneId long the zone to isolate
recenter bool recenter the map or not, defaults to not
Результат long[,,]

ShrinkMap() публичный статический Метод

Shrinks a map matrix to its exact needed coordinate bounds
public static ShrinkMap ( long map ) : long[,,]
map long
Результат long[,,]

TakeSliceOfMap() публичный статический Метод

Gives back the original map but with all rooms that fall outside of the indicated bounds removed
public static TakeSliceOfMap ( int>.Tuple xBounds, int>.Tuple yBounds, int>.Tuple zBounds, long map, bool shrink = false ) : long[,,]
xBounds int>.Tuple The upper and lower bounds to grab for X axis
yBounds int>.Tuple The upper and lower bounds to grab for Y axis
zBounds int>.Tuple The upper and lower bounds to grab for Z axis
map long The map to take from
shrink bool Return a new array that is bound to the size of the remaining data
Результат long[,,]