From 7d5ccd0c53f27da6288d81c41cf80fb891a925a8 Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Thu, 10 Apr 2025 03:24:25 +0200 Subject: [PATCH] Update source gen --- .../RoslynElements/UnlockLinkIdExtensions.cs | 19 +++++++++++++++++++ QuestPathGenerator/RoslynShortcuts.cs | 1 + 2 files changed, 20 insertions(+) create mode 100644 QuestPathGenerator/RoslynElements/UnlockLinkIdExtensions.cs diff --git a/QuestPathGenerator/RoslynElements/UnlockLinkIdExtensions.cs b/QuestPathGenerator/RoslynElements/UnlockLinkIdExtensions.cs new file mode 100644 index 00000000..feb73509 --- /dev/null +++ b/QuestPathGenerator/RoslynElements/UnlockLinkIdExtensions.cs @@ -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))))); + } +} diff --git a/QuestPathGenerator/RoslynShortcuts.cs b/QuestPathGenerator/RoslynShortcuts.cs index b04ad2c9..59e00f68 100644 --- a/QuestPathGenerator/RoslynShortcuts.cs +++ b/QuestPathGenerator/RoslynShortcuts.cs @@ -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(), -- 2.30.2