Questionable/QuestPathGenerator/RoslynElements/QuestIdExtensions.cs
2024-08-17 21:01:46 +02:00

20 lines
655 B
C#

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 QuestIdExtensions
{
public static ExpressionSyntax ToExpressionSyntax(this QuestId questId)
{
return ObjectCreationExpression(
IdentifierName(nameof(QuestId)))
.WithArgumentList(
ArgumentList(
SingletonSeparatedList(
Argument(LiteralValue(questId.Value)))));
}
}