cirnogodot/3D/TrenchBroom/EntityScripts/Triggers/ITargetable.cs
2025-09-10 11:08:47 +02:00

42 lines
No EOL
970 B
C#

using System;
using Cirno.Scripts;
using Godot;
using Godot.Collections;
namespace Cirno._3D.TrenchBroom.EntityScripts.Triggers;
public interface ITargetable
{
string TargetName { get; set; }
void ApplyTargetProperties(Dictionary<string, Variant> props)
{
TargetName = props["targetname"].AsString();
}
}
public interface ITargeting
{
string Target { get; set; }
void ApplyTargetingProperties(Dictionary<string, Variant> props)
{
Target = props["target"].AsString();
}
}
public interface IActivationType
{
ActivationType ActivationType { get; set; }
void ApplyActivationTypeProperties(Dictionary<string, Variant> props)
{
if (props.TryGetValue("activationtype", out var type))
{
var t = Enum.TryParse(type.AsString(), true, out ActivationType activationType);
if (t)
{
ActivationType = activationType;
}
}
}
}