Class ObjectReferenceExtensions
- Namespace
- SkyrimForge.World
- Assembly
- SkyrimForge.Game.dll
Provides extension members for IObjectReference.
public static class ObjectReferenceExtensions
- Inheritance
-
ObjectReferenceExtensions
- Inherited Members
Methods
PlacePackInAsync<TReference>(TReference, TES, TESDataHandler, IUtility, PackIn, NiPoint3, CancellationToken)
Disables the vegetation within DisabledVegetationRadius of origin,
then lays each part of packIn on the ground at its offset from origin.
public static Task<IReadOnlyDictionary<PackInPart, ObjectReference>> PlacePackInAsync<TReference>(this TReference reference, TES tes, TESDataHandler dataHandler, IUtility utility, PackIn packIn, NiPoint3 origin, CancellationToken cancellationToken = default) where TReference : notnull, IObjectReference
Parameters
referenceTReferencetesTESThe game's TES, through which the ground and the vegetation are read.
dataHandlerTESDataHandlerThe game's data handler.
utilityIUtilityThe service through which the task waits one second.
packInPackInThe parts to place.
originNiPoint3The position the parts' offsets are measured from, in this reference's worldspace or, in an interior, its cell.
cancellationTokenCancellationTokenCancels the one-second wait. The parts remain placed, and the task ends canceled without returning them. A new game or a save load also cancels the wait.
Returns
- Task<IReadOnlyDictionary<PackInPart, ObjectReference>>
The reference placed for each part, which excludes a part that MaximumTilt leaves out.
Type Parameters
TReference
Remarks
A part whose ground is not loaded is placed at the origin's height. The task waits a second for the parts' 3D to load, lays them on the ground again, and completes. FitsAt(TES, NiPoint3) tests whether every part is placed at an origin, and FindSite(TES, NiPoint3, float) searches for such an origin. Call on the game's thread.
Exceptions
- ArgumentNullException
utilityorpackInisnull.