From: Liza Carvelli Date: Thu, 10 Apr 2025 01:24:25 +0000 (+0200) Subject: Update source gen X-Git-Tag: v5.6~2 X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=7d5ccd0c53f27da6288d81c41cf80fb891a925a8;p=Questionable.git Update source gen --- 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(),