📝 added documentation and improved event scope

This commit is contained in:
2025-10-18 17:15:35 +02:00
parent 1e004b62b8
commit a593be8273
13 changed files with 175 additions and 102 deletions
@@ -0,0 +1,35 @@
using Godot;
using Godot.Collections;
namespace Babushka.scripts.CSharp.Low_Code.Events;
/// <summary>
/// Raises one or more <see cref="EventResource"/>s from the scene.
/// </summary>
public partial class EventRaiser : Node
{
/// <summary>
/// The <see cref="EventResource"/>s to call
/// </summary>
[Export] Array<EventResource> _eventResources;
/// <summary>
/// Raises all <see cref="EventResource"/>s present in <see cref="_eventResources"/>.
/// </summary>
public void RaiseEvents()
{
foreach (var eventRes in _eventResources)
{
eventRes.Raise();
}
}
/// <summary>
/// Raises <see cref="EventResource"/> at index.
/// </summary>
/// <param name="index"></param>
public void RaiseEvent(int index)
{
_eventResources[index].Raise();
}
}