Questionable/QuestPathGenerator/RoslynElements/LeveIdExtensions.cs

20 lines
650 B
C#
Raw Normal View History

2024-08-17 18:59:42 +00:00
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 LeveIdExtensions
{
public static ExpressionSyntax ToExpressionSyntax(this LeveId leveId)
{
return ObjectCreationExpression(
IdentifierName(nameof(LeveId)))
.WithArgumentList(
ArgumentList(
SingletonSeparatedList(
Argument(LiteralValue(leveId.Value)))));
}
}