Update source gen
authorLiza Carvelli <liza@carvel.li>
Thu, 10 Apr 2025 01:24:25 +0000 (03:24 +0200)
committerLiza Carvelli <liza@carvel.li>
Thu, 10 Apr 2025 01:24:48 +0000 (03:24 +0200)
QuestPathGenerator/RoslynElements/UnlockLinkIdExtensions.cs [new file with mode: 0644]
QuestPathGenerator/RoslynShortcuts.cs

diff --git a/QuestPathGenerator/RoslynElements/UnlockLinkIdExtensions.cs b/QuestPathGenerator/RoslynElements/UnlockLinkIdExtensions.cs
new file mode 100644 (file)
index 0000000..feb7350
--- /dev/null
@@ -0,0 +1,19 @@
+using Microsoft.CodeAnalysis.CSharp.Syntax;
+using Questionable.Model.Questing;
+using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
+using static Questionable.QuestPathGenerator.RoslynShortcuts;
+
+namespace Questionable.QuestPathGenerator.RoslynElements;
+
+internal static class UnlockLinkIdExtension
+{
+    public static ExpressionSyntax ToExpressionSyntax(this UnlockLinkId unlockLinkId)
+    {
+        return ObjectCreationExpression(
+                IdentifierName(nameof(UnlockLinkId)))
+            .WithArgumentList(
+                ArgumentList(
+                    SingletonSeparatedList(
+                        Argument(LiteralValue(unlockLinkId.Value)))));
+    }
+}
index b04ad2c..59e00f6 100644 (file)
@@ -51,6 +51,7 @@ public static class RoslynShortcuts
                 QuestId questId => questId.ToExpressionSyntax(),
                 SatisfactionSupplyNpcId satisfactionSupplyNpcId => satisfactionSupplyNpcId.ToExpressionSyntax(),
                 AlliedSocietyDailyId alliedSocietyDailyId => alliedSocietyDailyId.ToExpressionSyntax(),
+                UnlockLinkId unlockLinkId => unlockLinkId.ToExpressionSyntax(),
                 Vector3 vector => vector.ToExpressionSyntax(),
                 AethernetShortcut aethernetShortcut => aethernetShortcut.ToExpressionSyntax(),
                 ChatMessage chatMessage => chatMessage.ToExpressionSyntax(),