C# Class NetMud.Cartography.Cartographer

Methods for handling with the coordinate maps
Exibir arquivo Open project: SwiftAusterity/NetMud Class Usage Examples

Public Methods

Method 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

Method 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 method

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
return IRoomData

GenerateMapFromRoom() public static method

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
return long[,,]

GetRoomInDirection() public static method

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
return IRoomData

GetSinglePlane() public static method

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

GetZoneMap() public static method

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
return long[,,]

ShrinkMap() public static method

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

TakeSliceOfMap() public static method

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
return long[,,]