mirror of
https://github.com/MaddyThorson/StrawberryBF.git
synced 2025-02-18 11:38:28 +08:00
Console commands work
This commit is contained in:
parent
7e929f77fc
commit
d736ded07e
@ -66,7 +66,7 @@ namespace Strawberry
|
|||||||
return current >= startDelay && (current - startDelay) % (interval * 2) >= interval;
|
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)
|
for (let i < args.Count)
|
||||||
{
|
{
|
||||||
@ -119,7 +119,7 @@ namespace Strawberry
|
|||||||
[Inline]
|
[Inline]
|
||||||
static public void Log(StringView str, params Object[] args)
|
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);
|
Debug.WriteLine(string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ namespace Strawberry
|
|||||||
|
|
||||||
static public void Log(StringView str, params Object[] args)
|
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);
|
Log(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,16 +185,21 @@ namespace Strawberry
|
|||||||
|
|
||||||
public void Call(String[] args)
|
public void Call(String[] args)
|
||||||
{
|
{
|
||||||
let objs = scope Object[Method.ParamCount];
|
if (Method.ParamCount == 0)
|
||||||
for (let i < objs.Count)
|
Method.Invoke(null);
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (i < args.Count)
|
let objs = scope Object[Method.ParamCount];
|
||||||
objs[i] = Convert(args[i], Method.GetParamType(i));
|
for (let i < objs.Count)
|
||||||
else
|
{
|
||||||
objs[i] = Method.GetParamType(i).CreateValueDefault();
|
if (i < args.Count)
|
||||||
|
objs[i] = Convert(args[i], Method.GetParamType(i));
|
||||||
|
else
|
||||||
|
objs[i] = Method.GetParamType(i).CreateValueDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
Method.Invoke(null, params objs);
|
||||||
}
|
}
|
||||||
|
|
||||||
Method.Invoke(null, objs);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user