Create Complex Params Docs (#2160)

* create complex params docs

* Update docs/guides/int_framework/intro.md

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
This commit is contained in:
Cenk Ergen
2022-03-03 03:02:12 +03:00
committed by GitHub
parent 36d6ce9ec8
commit 5522bc443d
2 changed files with 52 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
public class Vector3
{
public int X {get;}
public int Y {get;}
public int Z {get;}
public Vector3()
{
X = 0;
Y = 0;
Z = 0;
}
[ComplexParameterCtor]
public Vector3(int x, int y, int z)
{
X = x;
Y = y;
Z = z;
}
}
// Both of the commands below are displayed to the users identically.
// With complex parameter
[SlashCommand("create-vector", "Create a 3D vector.")]
public async Task CreateVector([ComplexParameter]Vector3 vector3)
{
...
}
// Without complex parameter
[SlashCommand("create-vector", "Create a 3D vector.")]
public async Task CreateVector(int x, int y, int z)
{
...
}