Files
brick-framework/GameCore/Combat/DamageEventComponent.cs

15 lines
533 B
C#

using GameCore.ECS;
using GameCore.ECS.Interfaces;
namespace GameCore.Combat;
/// <summary>
/// A temporary, event-like component. When this component is added to an entity,
/// the DamageSystem will process it, apply damage to the target, and then
/// immediately remove this component. This simulates a one-time damage event.
/// </summary>
public class DamageEventComponent(Entity target, float amount) : IComponent
{
public Entity Target { get; set; } = target;
public float Amount { get; set; } = amount;
}