Add event publishing for inventory and combat interactions
This commit is contained in:
11
GameCore/Events/EntityDamagedEvent.cs
Normal file
11
GameCore/Events/EntityDamagedEvent.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using GameCore.ECS;
|
||||
using GameCore.Events.Interfaces;
|
||||
|
||||
namespace GameCore.Events;
|
||||
|
||||
public readonly struct EntityDamagedEvent(Entity target, float newHealth, float damageTaken) : IEvent
|
||||
{
|
||||
public readonly Entity Target = target;
|
||||
public readonly float NewHealth = newHealth;
|
||||
public readonly float DamageTaken = damageTaken;
|
||||
}
|
||||
13
GameCore/Events/HitscanImpactEvent.cs
Normal file
13
GameCore/Events/HitscanImpactEvent.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using GameCore.ECS;
|
||||
using GameCore.Events.Interfaces;
|
||||
using GameCore.Math;
|
||||
|
||||
namespace GameCore.Events;
|
||||
|
||||
public readonly struct HitscanImpactEvent(Entity owner, Vector3 from, Vector3 to, HitResult hit) : IEvent
|
||||
{
|
||||
public readonly Entity Owner = owner;
|
||||
public readonly Vector3 From = from;
|
||||
public readonly Vector3 To = to;
|
||||
public readonly HitResult Hit = hit;
|
||||
}
|
||||
10
GameCore/Events/InstantItemUsedEvent.cs
Normal file
10
GameCore/Events/InstantItemUsedEvent.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using GameCore.ECS;
|
||||
using GameCore.Events.Interfaces;
|
||||
|
||||
namespace GameCore.Events;
|
||||
|
||||
public readonly struct InstantItemUsedEvent(Entity picker, string itemId) : IEvent
|
||||
{
|
||||
public readonly Entity Picker = picker;
|
||||
public readonly string ItemId = itemId;
|
||||
}
|
||||
11
GameCore/Events/InventoryItemChangedEvent.cs
Normal file
11
GameCore/Events/InventoryItemChangedEvent.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using GameCore.ECS;
|
||||
using GameCore.Events.Interfaces;
|
||||
|
||||
namespace GameCore.Events;
|
||||
|
||||
public readonly struct InventoryItemChangedEvent(Entity owner, string itemId, int newQuantity) : IEvent
|
||||
{
|
||||
public readonly Entity Owner = owner;
|
||||
public readonly string ItemId = itemId;
|
||||
public readonly int NewQuantity = newQuantity;
|
||||
}
|
||||
10
GameCore/Events/ProjectileImpactEvent.cs
Normal file
10
GameCore/Events/ProjectileImpactEvent.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using GameCore.ECS;
|
||||
using GameCore.Events.Interfaces;
|
||||
|
||||
namespace GameCore.Events;
|
||||
|
||||
public readonly struct ProjectileImpactEvent(Entity projectile, HitResult hit) : IEvent
|
||||
{
|
||||
public readonly Entity ProjectileEntity = projectile;
|
||||
public readonly HitResult Hit = hit;
|
||||
}
|
||||
10
GameCore/Events/WeaponEquippedEvent.cs
Normal file
10
GameCore/Events/WeaponEquippedEvent.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using GameCore.ECS;
|
||||
using GameCore.Events.Interfaces;
|
||||
|
||||
namespace GameCore.Events;
|
||||
|
||||
public readonly struct WeaponEquippedEvent(Entity owner, string newWeaponItemId) : IEvent
|
||||
{
|
||||
public readonly Entity Owner = owner;
|
||||
public readonly string NewWeaponItemId = newWeaponItemId;
|
||||
}
|
||||
Reference in New Issue
Block a user