SupaLidlGame/Debug/DebugConsole.cs

35 lines
765 B
C#
Raw Normal View History

2023-07-24 12:40:28 -07:00
using Godot;
namespace SupaLidlGame.Debug;
public partial class DebugConsole : Node
{
public void SetProp(
Utils.World world,
string entityName,
string property,
string value)
{
var ent = world.CurrentMap.Entities.GetNodeOrNull(entityName);
if (ent is not null)
{
ent.Set(property, value);
}
}
public string CallMethod(
Utils.World world,
string entityName,
string method,
string[] args)
{
var ent = world.CurrentMap.Entities.GetNodeOrNull(entityName);
if (ent is not null)
{
var returnValue = ent.Call(method, args);
return returnValue.ToString();
}
return "";
}
}