C#C
C#6mo ago
29 replies
Yesn't

What's going on here?

Have no idea how to invoke event
// problem here, from within Entity class, different file, different namespace.
public virtual void onDeath()
{
    Event.Events.EntityDeath.Invoke();
    IsAlive = false;
}

// tryna use native support for events
public class Events
{
        public static event EventHandler? EntitySummoned;
        public static event EventHandler? EntityCreated;
        public static event EventHandler? EntityMovement;
        public static event EventHandler? EntityDeath; // huh, i guess i cant invoke from anything else
        public static event EventHandler? BuildingRemoval;
        public static event EventHandler? BuildingBuilt;
        public static event EventHandler? ConstructionRemoval;
        public static event EventHandler? ConstructionBuilt;
        public static event EventHandler? PlayerJoinEvent;
        public static event EventHandler? PlayerLeaveEvent;
}
Was this page helpful?