GodotMemberData.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System.Collections.Immutable;
  2. using Microsoft.CodeAnalysis;
  3. namespace Godot.SourceGenerators
  4. {
  5. public struct GodotMethodData
  6. {
  7. public GodotMethodData(IMethodSymbol method, ImmutableArray<MarshalType> paramTypes,
  8. ImmutableArray<ITypeSymbol> paramTypeSymbols, MarshalType? retType, ITypeSymbol? retSymbol)
  9. {
  10. Method = method;
  11. ParamTypes = paramTypes;
  12. ParamTypeSymbols = paramTypeSymbols;
  13. RetType = retType;
  14. RetSymbol = retSymbol;
  15. }
  16. public IMethodSymbol Method { get; }
  17. public ImmutableArray<MarshalType> ParamTypes { get; }
  18. public ImmutableArray<ITypeSymbol> ParamTypeSymbols { get; }
  19. public MarshalType? RetType { get; }
  20. public ITypeSymbol? RetSymbol { get; }
  21. }
  22. public struct GodotSignalDelegateData
  23. {
  24. public GodotSignalDelegateData(string name, INamedTypeSymbol delegateSymbol, GodotMethodData invokeMethodData)
  25. {
  26. Name = name;
  27. DelegateSymbol = delegateSymbol;
  28. InvokeMethodData = invokeMethodData;
  29. }
  30. public string Name { get; }
  31. public INamedTypeSymbol DelegateSymbol { get; }
  32. public GodotMethodData InvokeMethodData { get; }
  33. }
  34. public struct GodotPropertyData
  35. {
  36. public GodotPropertyData(IPropertySymbol propertySymbol, MarshalType type)
  37. {
  38. PropertySymbol = propertySymbol;
  39. Type = type;
  40. }
  41. public IPropertySymbol PropertySymbol { get; }
  42. public MarshalType Type { get; }
  43. }
  44. public struct GodotFieldData
  45. {
  46. public GodotFieldData(IFieldSymbol fieldSymbol, MarshalType type)
  47. {
  48. FieldSymbol = fieldSymbol;
  49. Type = type;
  50. }
  51. public IFieldSymbol FieldSymbol { get; }
  52. public MarshalType Type { get; }
  53. }
  54. }