2022-08-05 03:32:59 +02:00
|
|
|
using System.Collections.Immutable;
|
|
|
|
using System.Linq;
|
|
|
|
using Microsoft.CodeAnalysis;
|
|
|
|
|
|
|
|
namespace Godot.SourceGenerators.Internal;
|
|
|
|
|
2022-07-07 17:58:13 +02:00
|
|
|
internal readonly struct CallbacksData
|
2022-08-05 03:32:59 +02:00
|
|
|
{
|
|
|
|
public CallbacksData(INamedTypeSymbol nativeTypeSymbol, INamedTypeSymbol funcStructSymbol)
|
|
|
|
{
|
|
|
|
NativeTypeSymbol = nativeTypeSymbol;
|
|
|
|
FuncStructSymbol = funcStructSymbol;
|
|
|
|
Methods = NativeTypeSymbol.GetMembers()
|
|
|
|
.Where(symbol => symbol is IMethodSymbol { IsPartialDefinition: true })
|
|
|
|
.Cast<IMethodSymbol>()
|
|
|
|
.ToImmutableArray();
|
|
|
|
}
|
|
|
|
|
|
|
|
public INamedTypeSymbol NativeTypeSymbol { get; }
|
|
|
|
|
|
|
|
public INamedTypeSymbol FuncStructSymbol { get; }
|
|
|
|
|
|
|
|
public ImmutableArray<IMethodSymbol> Methods { get; }
|
|
|
|
}
|