Class MapMarkerExtensions
- Namespace
- SkyrimForge.Game
- Assembly
- SkyrimForge.Game.dll
Provides extension members for MapMarker, a sequence of them, and GameTarget.
public static class MapMarkerExtensions
- Inheritance
-
MapMarkerExtensions
- Inherited Members
Methods
FindByReferenceId(FormId<ObjectReference>)
Finds the map marker whose reference has the form ID referenceId. The result is null where that reference is no named map marker.
public static MapMarker? FindByReferenceId(FormId<ObjectReference> referenceId)
Parameters
referenceIdFormId<ObjectReference>
Returns
GetMapMarkers(GameTarget)
Reads every named map marker of every worldspace.
public static IReadOnlyList<MapMarker> GetMapMarkers(this GameTarget gameTarget)
Parameters
gameTargetGameTarget
Returns
Remarks
The first call enumerates each worldspace's persistent cell, so a marker created after it is not included.
GetNearest(IEnumerable<MapMarker>, FormId<WorldSpace>?, NiPoint3, Func<MapMarker, bool>?)
Returns the marker in worldspaceId nearest position in the horizontal plane, among those that pass predicate.
A null worldspaceId matches no marker, and a null predicate accepts every marker.
public static MapMarker? GetNearest(this IEnumerable<MapMarker> markers, FormId<WorldSpace>? worldspaceId, NiPoint3 position, Func<MapMarker, bool>? predicate = null)
Parameters
markersIEnumerable<MapMarker>worldspaceIdFormId<WorldSpace>?positionNiPoint3predicateFunc<MapMarker, bool>
Returns
GetWorldspaceId(IEnumerable<MapMarker>, Location)
The worldspace of the marker whose location contains location.
public static FormId<WorldSpace>? GetWorldspaceId(this IEnumerable<MapMarker> markers, Location location)
Parameters
markersIEnumerable<MapMarker>locationLocationThe location to resolve, such as the one an actor stands in.
Returns
- FormId<WorldSpace>?
The worldspace's form ID, or
nullwhere no marker's location contains it.
Remarks
An actor inside a building has no worldspace of its own, and the marker of the settlement containing that interior states the worldspace.