Add uREPL passthru for calling in-game commands
This commit is contained in:
parent
c1bb863578
commit
c6f8afa812
1 changed files with 42 additions and 0 deletions
42
GamecraftModdingAPI/Commands/ExistingCommands.cs
Normal file
42
GamecraftModdingAPI/Commands/ExistingCommands.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using System;
|
||||
|
||||
using uREPL;
|
||||
|
||||
namespace GamecraftModdingAPI.Commands
|
||||
{
|
||||
public static class ExistingCommands
|
||||
{
|
||||
public static void Call(string commandName)
|
||||
{
|
||||
RuntimeCommands.Call(commandName);
|
||||
}
|
||||
|
||||
public static void Call<Arg0>(string commandName, Arg0 arg0)
|
||||
{
|
||||
RuntimeCommands.Call<Arg0>(commandName, arg0);
|
||||
}
|
||||
|
||||
public static void Call<Arg0, Arg1>(string commandName, Arg0 arg0, Arg1 arg1)
|
||||
{
|
||||
RuntimeCommands.Call<Arg0, Arg1>(commandName, arg0, arg1);
|
||||
}
|
||||
|
||||
public static void Call<Arg0, Arg1, Arg2>(string commandName, Arg0 arg0, Arg1 arg1, Arg2 arg2)
|
||||
{
|
||||
RuntimeCommands.Call<Arg0, Arg1, Arg2>(commandName, arg0, arg1, arg2);
|
||||
}
|
||||
|
||||
public static bool Exists(string commandName)
|
||||
{
|
||||
return RuntimeCommands.HasRegistered(commandName);
|
||||
}
|
||||
|
||||
public static string[] GetCommandNames()
|
||||
{
|
||||
var keys = RuntimeCommands.table.Keys;
|
||||
string[] res = new string[keys.Count];
|
||||
keys.CopyTo(res, 0);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue