Browse Source

Merge pull request #42007 from HaSa1002/callable-docs

Document missing Callable methods
Rémi Verschelde 4 years ago
parent
commit
bd42a6c51e
1 changed files with 9 additions and 1 deletions
  1. 9 1
      doc/classes/Callable.xml

+ 9 - 1
doc/classes/Callable.xml

@@ -18,7 +18,7 @@
 		    callable.call("invalid")  # Invalid call, should have at least 2 arguments.
 		    callable.call("invalid")  # Invalid call, should have at least 2 arguments.
 		[/gdscript]
 		[/gdscript]
 		[csharp]
 		[csharp]
-		Callable callable = new Callable(this, "print_args");
+		Callable callable = new Callable(this, nameof("printArgs"));
 		public void PrintArgs(object arg1, object arg2, object arg3 = "")
 		public void PrintArgs(object arg1, object arg2, object arg3 = "")
 		{
 		{
 		    GD.PrintS(arg1, arg2, arg3);
 		    GD.PrintS(arg1, arg2, arg3);
@@ -67,6 +67,7 @@
 			<return type="Callable">
 			<return type="Callable">
 			</return>
 			</return>
 			<description>
 			<description>
+				Returns a copy of this [Callable] with the arguments bound. Bound arguments are passed after the arguments supplied by [method call].
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="call" qualifiers="vararg">
 		<method name="call" qualifiers="vararg">
@@ -108,24 +109,28 @@
 			<return type="int">
 			<return type="int">
 			</return>
 			</return>
 			<description>
 			<description>
+				Returns the hash value of this [Callable]'s object.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="is_custom">
 		<method name="is_custom">
 			<return type="bool">
 			<return type="bool">
 			</return>
 			</return>
 			<description>
 			<description>
+				Returns [code]true[/code] if this [Callable] is a custom callable whose behavior differs based on implementation details. Custom callables are used in the engine for various reasons. If [code]true[/code], you can't use [method get_method].
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="is_null">
 		<method name="is_null">
 			<return type="bool">
 			<return type="bool">
 			</return>
 			</return>
 			<description>
 			<description>
+				Returns [code]true[/code] if this [Callable] has no target to call the method on.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="is_standard">
 		<method name="is_standard">
 			<return type="bool">
 			<return type="bool">
 			</return>
 			</return>
 			<description>
 			<description>
+				Returns [code]true[/code] if this [Callable] is a standard callable, referencing an object and a method using a [StringName].
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="operator !=" qualifiers="operator">
 		<method name="operator !=" qualifiers="operator">
@@ -134,6 +139,7 @@
 			<argument index="0" name="right" type="Callable">
 			<argument index="0" name="right" type="Callable">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Returns [code]true[/code] if both [Callable]s invoke different targets.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="operator ==" qualifiers="operator">
 		<method name="operator ==" qualifiers="operator">
@@ -142,6 +148,7 @@
 			<argument index="0" name="right" type="Callable">
 			<argument index="0" name="right" type="Callable">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Returns [code]true[/code] if both [Callable]s invoke the same custom target.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="unbind">
 		<method name="unbind">
@@ -150,6 +157,7 @@
 			<argument index="0" name="argcount" type="int">
 			<argument index="0" name="argcount" type="int">
 			</argument>
 			</argument>
 			<description>
 			<description>
+				Returns a copy of this [Callable] with the arguments unbound. Calling the returned [Callable] will call the method without the extra arguments that are supplied in the [Callable] on which you are calling this method.
 			</description>
 			</description>
 		</method>
 		</method>
 	</methods>
 	</methods>