C# Class NetMud.Cartography.Cartographer

Methods for handling with the coordinate maps
Afficher le fichier Open project: SwiftAusterity/NetMud Class Usage Examples

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
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[,,]

Method Details

FindCenterOfMap() public static méthode

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
Résultat IRoomData

GenerateMapFromRoom() public static méthode

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
Résultat long[,,]

GetRoomInDirection() public static méthode

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
Résultat IRoomData

GetSinglePlane() public static méthode

Render a 3d map down to 2d
public static GetSinglePlane ( long fullMap, int zIndex ) : ].long[
fullMap long
zIndex int
Résultat ].long[

GetZoneMap() public static méthode

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
Résultat long[,,]

ShrinkMap() public static méthode

Shrinks a map matrix to its exact needed coordinate bounds
public static ShrinkMap ( long map ) : long[,,]
map long
Résultat long[,,]

TakeSliceOfMap() public static méthode

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
Résultat long[,,]