Console commands work

This commit is contained in:
Matt Thorson 2020-06-24 23:04:37 -07:00
parent 7e929f77fc
commit d736ded07e
2 changed files with 16 additions and 11 deletions

View File

@ -66,7 +66,7 @@ namespace Strawberry
return current >= startDelay && (current - startDelay) % (interval * 2) >= interval;
}
static public String StringArgs(String str, Object[] args)
static public String StringArgs(String str, params Object[] args)
{
for (let i < args.Count)
{
@ -119,7 +119,7 @@ namespace Strawberry
[Inline]
static public void Log(StringView str, params Object[] args)
{
let string = StringArgs(scope String(str), args);
let string = StringArgs(scope String(str), params args);
Debug.WriteLine(string);
}
}

View File

@ -85,7 +85,7 @@ namespace Strawberry
static public void Log(StringView str, params Object[] args)
{
let string = Calc.[Friend]StringArgs(scope String(str), args);
let string = Calc.[Friend]StringArgs(scope String(str), params args);
Log(string);
}
@ -184,6 +184,10 @@ namespace Strawberry
}
public void Call(String[] args)
{
if (Method.ParamCount == 0)
Method.Invoke(null);
else
{
let objs = scope Object[Method.ParamCount];
for (let i < objs.Count)
@ -194,7 +198,8 @@ namespace Strawberry
objs[i] = Method.GetParamType(i).CreateValueDefault();
}
Method.Invoke(null, objs);
Method.Invoke(null, params objs);
}
}
}