Add params tag to API_PARAM for C# variadic parameters support
This commit is contained in:
@@ -1203,6 +1203,8 @@ namespace Flax.Build.Bindings
|
||||
contents.Append("ref ");
|
||||
else if (parameterInfo.IsThis)
|
||||
contents.Append("this ");
|
||||
else if (parameterInfo.IsParams)
|
||||
contents.Append("params ");
|
||||
contents.Append(managedType);
|
||||
contents.Append(' ');
|
||||
contents.Append(parameterInfo.Name);
|
||||
@@ -1263,6 +1265,8 @@ namespace Flax.Build.Bindings
|
||||
contents.Append("ref ");
|
||||
else if (parameterInfo.IsThis)
|
||||
contents.Append("this ");
|
||||
else if (parameterInfo.IsParams)
|
||||
contents.Append("params ");
|
||||
contents.Append(managedType);
|
||||
contents.Append(' ');
|
||||
contents.Append(parameterInfo.Name);
|
||||
@@ -1988,6 +1992,8 @@ namespace Flax.Build.Bindings
|
||||
contents.Append("ref ");
|
||||
else if (parameterInfo.IsThis)
|
||||
contents.Append("this ");
|
||||
else if (parameterInfo.IsParams)
|
||||
contents.Append("params ");
|
||||
contents.Append(managedType);
|
||||
contents.Append(' ');
|
||||
contents.Append(parameterInfo.Name);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Flax.Build.Bindings
|
||||
partial class BindingsGenerator
|
||||
{
|
||||
private static readonly Dictionary<string, Type> TypeCache = new Dictionary<string, Type>();
|
||||
private const int CacheVersion = 18;
|
||||
private const int CacheVersion = 19;
|
||||
|
||||
internal static void Write(BinaryWriter writer, string e)
|
||||
{
|
||||
|
||||
@@ -337,6 +337,9 @@ namespace Flax.Build.Bindings
|
||||
case "this":
|
||||
currentParam.IsThis = true;
|
||||
break;
|
||||
case "params":
|
||||
currentParam.IsParams = true;
|
||||
break;
|
||||
case "attributes":
|
||||
currentParam.Attributes = tag.Value;
|
||||
break;
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace Flax.Build.Bindings
|
||||
public bool IsRef;
|
||||
public bool IsOut;
|
||||
public bool IsThis;
|
||||
public bool IsParams;
|
||||
|
||||
public bool HasDefaultValue => !string.IsNullOrEmpty(DefaultValue);
|
||||
|
||||
@@ -37,6 +38,7 @@ namespace Flax.Build.Bindings
|
||||
writer.Write(IsRef);
|
||||
writer.Write(IsOut);
|
||||
writer.Write(IsThis);
|
||||
writer.Write(IsParams);
|
||||
}
|
||||
|
||||
public void Read(BinaryReader reader)
|
||||
@@ -49,6 +51,7 @@ namespace Flax.Build.Bindings
|
||||
IsRef = reader.ReadBoolean();
|
||||
IsOut = reader.ReadBoolean();
|
||||
IsThis = reader.ReadBoolean();
|
||||
IsParams = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
|
||||
Reference in New Issue
Block a user