mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #81701 from Repiteo/c#-attribute-interface-doc
C#: Add documentation for Interfaces and Attributes
This commit is contained in:
commit
00574d4ba5
5 changed files with 34 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
namespace Godot
|
namespace Godot
|
||||||
{
|
{
|
||||||
|
@ -8,7 +9,7 @@ namespace Godot
|
||||||
/// the name associated with the class. If the attribute is not present,
|
/// the name associated with the class. If the attribute is not present,
|
||||||
/// the C# class name can be used instead.
|
/// the C# class name can be used instead.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[AttributeUsage(AttributeTargets.Class)]
|
[AttributeUsage(AttributeTargets.Class), EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
public class GodotClassNameAttribute : Attribute
|
public class GodotClassNameAttribute : Attribute
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -16,6 +17,10 @@ namespace Godot
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name { get; }
|
public string Name { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Specify the name that represents the original engine class.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">Name of the original engine class.</param>
|
||||||
public GodotClassNameAttribute(string name)
|
public GodotClassNameAttribute(string name)
|
||||||
{
|
{
|
||||||
Name = name;
|
Name = name;
|
||||||
|
|
|
@ -2,6 +2,11 @@ using System;
|
||||||
|
|
||||||
namespace Godot
|
namespace Godot
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Declares a <see langword="delegate"/> as a signal. This allows any connected
|
||||||
|
/// <see cref="Callable"/> (and, by extension, their respective objects) to listen and react
|
||||||
|
/// to events, without directly referencing one another.
|
||||||
|
/// </summary>
|
||||||
[AttributeUsage(AttributeTargets.Delegate)]
|
[AttributeUsage(AttributeTargets.Delegate)]
|
||||||
public sealed class SignalAttribute : Attribute { }
|
public sealed class SignalAttribute : Attribute { }
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,9 @@ using System;
|
||||||
|
|
||||||
namespace Godot
|
namespace Godot
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Allows the annotated class to execute in the editor.
|
||||||
|
/// </summary>
|
||||||
[AttributeUsage(AttributeTargets.Class)]
|
[AttributeUsage(AttributeTargets.Class)]
|
||||||
public sealed class ToolAttribute : Attribute { }
|
public sealed class ToolAttribute : Attribute { }
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,10 @@ namespace Godot
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IAwaitable
|
public interface IAwaitable
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets an Awaiter for this <see cref="IAwaitable"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>An Awaiter.</returns>
|
||||||
IAwaiter GetAwaiter();
|
IAwaiter GetAwaiter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +18,10 @@ namespace Godot
|
||||||
/// <typeparam name="TResult">A reference to the result to be passed out.</typeparam>
|
/// <typeparam name="TResult">A reference to the result to be passed out.</typeparam>
|
||||||
public interface IAwaitable<out TResult>
|
public interface IAwaitable<out TResult>
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets an Awaiter for this <see cref="IAwaitable{TResult}"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>An Awaiter.</returns>
|
||||||
IAwaiter<TResult> GetAwaiter();
|
IAwaiter<TResult> GetAwaiter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,14 @@ namespace Godot
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IAwaiter : INotifyCompletion
|
public interface IAwaiter : INotifyCompletion
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The completion status of this <see cref="IAwaiter"/>.
|
||||||
|
/// </summary>
|
||||||
bool IsCompleted { get; }
|
bool IsCompleted { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the result of completion for this <see cref="IAwaiter"/>.
|
||||||
|
/// </summary>
|
||||||
void GetResult();
|
void GetResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,8 +24,14 @@ namespace Godot
|
||||||
/// <typeparam name="TResult">A reference to the result to be passed out.</typeparam>
|
/// <typeparam name="TResult">A reference to the result to be passed out.</typeparam>
|
||||||
public interface IAwaiter<out TResult> : INotifyCompletion
|
public interface IAwaiter<out TResult> : INotifyCompletion
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The completion status of this <see cref="IAwaiter{TResult}"/>.
|
||||||
|
/// </summary>
|
||||||
bool IsCompleted { get; }
|
bool IsCompleted { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the result of completion for this <see cref="IAwaiter{TResult}"/>.
|
||||||
|
/// </summary>
|
||||||
TResult GetResult();
|
TResult GetResult();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue