Skip to content

Commit

Permalink
Convert FormLink to NullableFormLink cheat sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
Noggog committed Feb 7, 2024
1 parent d487c58 commit 54838e0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/Big-Cheat-Sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ if (linkCache.TryResolve(formLink, out var foundRecord))
Using the [FormKey Generator](https://github.com/Mutagen-Modding/Mutagen.Bethesda.FormKeys) project is a good alternative to hand constructing FormLinks"

## Convert FormKey to FormID
=== Via MasterReferenceCollection
=== MasterReferenceCollection
``` { .cs hl_lines="4" }
FormKey formKey = ...;
IMasterReferenceCollection masterCollection = ...;
Expand All @@ -121,6 +121,23 @@ var npcLink = formKey.ToLink<INpcGetter>();

[:octicons-arrow-right-24: FormLinks](plugins/ModKey, FormKey, FormLink.md#formlink)

## Convert FormLink to NullableFormLink
=== SetTo
``` { .cs hl_lines="4" }
IFormLinkGetter<IEquipTypeGetter> link = ...;
IFormLinkNullableGetter<IEquipTypeGetter> nullableLink = ...;

nullableLink.SetTo(link);
```
=== AsNullable
``` { .cs hl_lines="3" }
IFormLinkGetter<IEquipTypeGetter> link = ...;

IFormLinkNullableGetter<IEquipTypeGetter> nullableLink = link.AsNullable();
```

[:octicons-arrow-right-24: FormLinks](plugins/ModKey, FormKey, FormLink.md#formlink)

## Convert MajorRecord to FormLink
``` cs
INpcGetter npcGetter = ...;
Expand Down

0 comments on commit 54838e0

Please sign in to comment.