diff --git a/Engine.Core/Abstract/Assignable/IAssignable.cs b/Engine.Core/Abstract/Assignable/IAssignable.cs index a7be526..bd4af57 100644 --- a/Engine.Core/Abstract/Assignable/IAssignable.cs +++ b/Engine.Core/Abstract/Assignable/IAssignable.cs @@ -8,7 +8,7 @@ public interface IAssignable /// /// Event triggered when the 's fields are unassigned and completely ready to recycle. /// - event OnUnassignedDelegate? OnUnassigned; + event OnUnassignedEventHandler? OnUnassigned; /// /// Unassign 's all fields and make it ready to recycle. @@ -18,5 +18,5 @@ public interface IAssignable /// bool Unassign(); - delegate void OnUnassignedDelegate(IAssignable sender); + delegate void OnUnassignedEventHandler(IAssignable sender); } diff --git a/Engine.Core/Abstract/Assignable/IAssignableBehaviourController.cs b/Engine.Core/Abstract/Assignable/IAssignableBehaviourController.cs index 7c58146..0365bd6 100644 --- a/Engine.Core/Abstract/Assignable/IAssignableBehaviourController.cs +++ b/Engine.Core/Abstract/Assignable/IAssignableBehaviourController.cs @@ -8,7 +8,7 @@ public interface IAssignableBehaviourController : IAssignable /// /// Event triggered when the value has has been assigned a new value. /// - event OnBehaviourControllerAssignedDelegate? OnBehaviourControllerAssigned; + event OnBehaviourControllerAssignedEventHandler? OnBehaviourControllerAssigned; /// IBehaviourController BehaviourController { get; } @@ -22,5 +22,5 @@ public interface IAssignableBehaviourController : IAssignable /// bool Assign(IBehaviourController behaviourController); - delegate void OnBehaviourControllerAssignedDelegate(IAssignableBehaviourController sender); + delegate void OnBehaviourControllerAssignedEventHandler(IAssignableBehaviourController sender); } diff --git a/Engine.Core/Abstract/Assignable/IAssignableEntity.cs b/Engine.Core/Abstract/Assignable/IAssignableEntity.cs index b6a472a..ad96566 100644 --- a/Engine.Core/Abstract/Assignable/IAssignableEntity.cs +++ b/Engine.Core/Abstract/Assignable/IAssignableEntity.cs @@ -8,7 +8,7 @@ public interface IAssignableEntity : IAssignable /// /// Event triggered when the value has has been assigned a new value. /// - event OnEntityAssignedDelegate? OnEntityAssigned; + event OnEntityAssignedEventHandler? OnEntityAssigned; /// IEntity Entity { get; } @@ -22,5 +22,5 @@ public interface IAssignableEntity : IAssignable /// bool Assign(IEntity entity); - delegate void OnEntityAssignedDelegate(IAssignableEntity sender); + delegate void OnEntityAssignedEventHandler(IAssignableEntity sender); } diff --git a/Engine.Core/Abstract/Assignable/IAssignableGameManager.cs b/Engine.Core/Abstract/Assignable/IAssignableGameManager.cs index ebd21cc..27f9559 100644 --- a/Engine.Core/Abstract/Assignable/IAssignableGameManager.cs +++ b/Engine.Core/Abstract/Assignable/IAssignableGameManager.cs @@ -8,7 +8,7 @@ public interface IAssignableGameManager : IAssignable /// /// Event triggered when the value has has been assigned a new value. /// - event OnGameManagerAssignedDelegate? OnGameManagerAssigned; + event OnGameManagerAssignedEventHandler? OnGameManagerAssigned; /// IGameManager GameManager { get; } @@ -22,5 +22,5 @@ public interface IAssignableGameManager : IAssignable /// bool Assign(IGameManager gameManager); - delegate void OnGameManagerAssignedDelegate(IAssignableGameManager sender); + delegate void OnGameManagerAssignedEventHandler(IAssignableGameManager sender); } diff --git a/Engine.Core/Abstract/Assignable/IAssignableGameObject.cs b/Engine.Core/Abstract/Assignable/IAssignableGameObject.cs index b6c30f6..fbcfcca 100644 --- a/Engine.Core/Abstract/Assignable/IAssignableGameObject.cs +++ b/Engine.Core/Abstract/Assignable/IAssignableGameObject.cs @@ -8,7 +8,7 @@ public interface IAssignableGameObject : IAssignable /// /// Event triggered when the value has has been assigned a new value. /// - event OnGameObjectAssignedDelegate? OnGameObjectAssigned; + event OnGameObjectAssignedEventHandler? OnGameObjectAssigned; /// IGameObject GameObject { get; } @@ -22,5 +22,5 @@ public interface IAssignableGameObject : IAssignable /// bool Assign(IGameObject gameObject); - delegate void OnGameObjectAssignedDelegate(IAssignableGameObject sender); + delegate void OnGameObjectAssignedEventHandler(IAssignableGameObject sender); } diff --git a/Engine.Core/Abstract/Assignable/IAssignableStateEnable.cs b/Engine.Core/Abstract/Assignable/IAssignableStateEnable.cs index 32cc090..8a366f6 100644 --- a/Engine.Core/Abstract/Assignable/IAssignableStateEnable.cs +++ b/Engine.Core/Abstract/Assignable/IAssignableStateEnable.cs @@ -8,7 +8,7 @@ public interface IAssignableStateEnable : IAssignable /// /// Event triggered when the value has has been assigned a new value. /// - event OnStateEnableAssignedDelegate? OnStateEnableAssigned; + event OnStateEnableAssignedEventHandler? OnStateEnableAssigned; /// IStateEnable StateEnable { get; } @@ -22,5 +22,5 @@ public interface IAssignableStateEnable : IAssignable /// bool Assign(IStateEnable stateEnable); - delegate void OnStateEnableAssignedDelegate(IAssignableStateEnable sender); + delegate void OnStateEnableAssignedEventHandler(IAssignableStateEnable sender); } diff --git a/Engine.Core/Abstract/Assignable/IAssignableTransform.cs b/Engine.Core/Abstract/Assignable/IAssignableTransform.cs index a769408..797c1b7 100644 --- a/Engine.Core/Abstract/Assignable/IAssignableTransform.cs +++ b/Engine.Core/Abstract/Assignable/IAssignableTransform.cs @@ -8,7 +8,7 @@ public interface IAssignableTransform : IAssignable /// /// Event triggered when the value has has been assigned a new value. /// - event OnTransformAssignedDelegate? OnTransformAssigned; + event OnTransformAssignedEventHandler? OnTransformAssigned; /// ITransform Transform { get; } @@ -22,5 +22,5 @@ public interface IAssignableTransform : IAssignable /// bool Assign(ITransform transform); - delegate void OnTransformAssignedDelegate(IAssignableTransform sender); + delegate void OnTransformAssignedEventHandler(IAssignableTransform sender); } diff --git a/Engine.Core/Abstract/Assignable/IHierarchyObject.cs b/Engine.Core/Abstract/Assignable/IHierarchyObject.cs index 04308a0..ccc153b 100644 --- a/Engine.Core/Abstract/Assignable/IHierarchyObject.cs +++ b/Engine.Core/Abstract/Assignable/IHierarchyObject.cs @@ -10,12 +10,12 @@ public interface IHierarchyObject : IEntity, INameable /// /// Event triggered when the enters the hierarchy. /// - event OnEnteredHierarchyDelegate? OnEnteredHierarchy; + event OnEnteredHierarchyEventHandler? OnEnteredHierarchy; /// /// Event triggered when the exits the hierarchy. /// - event OnExitedHierarchyDelegate? OnExitedHierarchy; + event OnExitedHierarchyEventHandler? OnExitedHierarchy; /// /// Gets the associated with this , if any. @@ -49,16 +49,16 @@ public interface IHierarchyObject : IEntity, INameable internal bool ExitHierarchy(); /// - /// Delegate type for the event triggered when the enters the hierarchy of a . + /// EventHandler delegate for the event triggered when the enters the hierarchy of a . /// /// The that entered the hierarchy. /// The that the has entered it's hierarchy. - delegate void OnEnteredHierarchyDelegate(IHierarchyObject sender, IGameManager gameManager); + delegate void OnEnteredHierarchyEventHandler(IHierarchyObject sender, IGameManager gameManager); /// - /// Delegate type for the event triggered when the exits the hierarchy of a . + /// EventHandler delegate for the event triggered when the exits the hierarchy of a . /// /// The that exited the hierarchy. /// The that the has exited it's hierarchy. - delegate void OnExitedHierarchyDelegate(IHierarchyObject sender, IGameManager gameManager); + delegate void OnExitedHierarchyEventHandler(IHierarchyObject sender, IGameManager gameManager); } diff --git a/Engine.Core/Abstract/BaseEntity.cs b/Engine.Core/Abstract/BaseEntity.cs index ac68da3..2209087 100644 --- a/Engine.Core/Abstract/BaseEntity.cs +++ b/Engine.Core/Abstract/BaseEntity.cs @@ -6,13 +6,13 @@ namespace Syntriax.Engine.Core.Abstract; public abstract class BaseEntity : IEntity { - public event IEntity.OnIdChangedDelegate? OnIdChanged = null; + public event IEntity.OnIdChangedEventHandler? OnIdChanged = null; - public event IInitialize.OnInitializedDelegate? OnInitialized = null; - public event IInitialize.OnFinalizedDelegate? OnFinalized = null; + public event IInitialize.OnInitializedEventHandler? OnInitialized = null; + public event IInitialize.OnFinalizedEventHandler? OnFinalized = null; - public event IAssignableStateEnable.OnStateEnableAssignedDelegate? OnStateEnableAssigned = null; - public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; + public event IAssignableStateEnable.OnStateEnableAssignedEventHandler? OnStateEnableAssigned = null; + public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null; private IStateEnable _stateEnable = null!; diff --git a/Engine.Core/Abstract/IBehaviour.cs b/Engine.Core/Abstract/IBehaviour.cs index c0cf599..fe725f1 100644 --- a/Engine.Core/Abstract/IBehaviour.cs +++ b/Engine.Core/Abstract/IBehaviour.cs @@ -8,7 +8,7 @@ public interface IBehaviour : IEntity, IAssignableBehaviourController, IAssignab /// /// Event triggered when the priority of the changes. /// - event OnPriorityChangedDelegate? OnPriorityChanged; + event OnPriorityChangedEventHandler? OnPriorityChanged; /// /// The priority of the . @@ -20,5 +20,5 @@ public interface IBehaviour : IEntity, IAssignableBehaviourController, IAssignab /// bool IsActive { get; } - delegate void OnPriorityChangedDelegate(IBehaviour sender, int previousPriority); + delegate void OnPriorityChangedEventHandler(IBehaviour sender, int previousPriority); } diff --git a/Engine.Core/Abstract/IBehaviourController.cs b/Engine.Core/Abstract/IBehaviourController.cs index 65964cd..914b80a 100644 --- a/Engine.Core/Abstract/IBehaviourController.cs +++ b/Engine.Core/Abstract/IBehaviourController.cs @@ -11,27 +11,27 @@ public interface IBehaviourController : IInitialize, IAssignableGameObject, IEnu /// /// Event triggered before the update of s. /// - event OnPreUpdateDelegate? OnPreUpdate; + event OnPreUpdateEventHandler? OnPreUpdate; /// /// Event triggered during the update of s. /// - event OnUpdateDelegate? OnUpdate; + event OnUpdateEventHandler? OnUpdate; /// /// Event triggered before the drawing phase. /// - event OnPreDrawDelegate? OnPreDraw; + event OnPreDrawEventHandler? OnPreDraw; /// /// Event triggered when a is added to the . /// - event OnBehaviourAddedDelegate? OnBehaviourAdded; + event OnBehaviourAddedEventHandler? OnBehaviourAdded; /// /// Event triggered when a is removed from the . /// - event OnBehaviourRemovedDelegate? OnBehaviourRemoved; + event OnBehaviourRemovedEventHandler? OnBehaviourRemoved; /// /// Adds a to the . @@ -102,10 +102,10 @@ public interface IBehaviourController : IInitialize, IAssignableGameObject, IEnu /// void UpdatePreDraw(); - delegate void OnPreUpdateDelegate(IBehaviourController sender); - delegate void OnUpdateDelegate(IBehaviourController sender); - delegate void OnPreDrawDelegate(IBehaviourController sender); - delegate void OnBehaviourAddedDelegate(IBehaviourController sender, IBehaviour behaviourAdded); - delegate void OnBehaviourRemovedDelegate(IBehaviourController sender, IBehaviour behaviourRemoved); + delegate void OnPreUpdateEventHandler(IBehaviourController sender); + delegate void OnUpdateEventHandler(IBehaviourController sender); + delegate void OnPreDrawEventHandler(IBehaviourController sender); + delegate void OnBehaviourAddedEventHandler(IBehaviourController sender, IBehaviour behaviourAdded); + delegate void OnBehaviourRemovedEventHandler(IBehaviourController sender, IBehaviour behaviourRemoved); } diff --git a/Engine.Core/Abstract/IEntity.cs b/Engine.Core/Abstract/IEntity.cs index 640dd6e..34acf3b 100644 --- a/Engine.Core/Abstract/IEntity.cs +++ b/Engine.Core/Abstract/IEntity.cs @@ -9,12 +9,12 @@ public interface IEntity : IInitialize, IAssignableStateEnable /// Event triggered when the of the changes. /// The string action parameter is the previous of the . /// - event OnIdChangedDelegate? OnIdChanged; + event OnIdChangedEventHandler? OnIdChanged; /// /// The ID of the . /// string Id { get; set; } - delegate void OnIdChangedDelegate(IEntity sender, string previousId); + delegate void OnIdChangedEventHandler(IEntity sender, string previousId); } diff --git a/Engine.Core/Abstract/IGameManager.cs b/Engine.Core/Abstract/IGameManager.cs index 5e46e34..5433888 100644 --- a/Engine.Core/Abstract/IGameManager.cs +++ b/Engine.Core/Abstract/IGameManager.cs @@ -10,32 +10,32 @@ public interface IGameManager : IEntity /// /// Event triggered when is called on the . /// - event OnUpdateDelegate? OnUpdate; + event OnUpdateEventHandler? OnUpdate; /// /// Event triggered when is called on the . /// - event OnPreDawDelegate? OnPreDraw; + event OnPreDawEventHandler? OnPreDraw; /// /// Event triggered when a is registered to the . /// - event OnGameObjectRegisteredDelegate? OnGameObjectRegistered; + event OnGameObjectRegisteredEventHandler? OnGameObjectRegistered; /// /// Event triggered when a is unregistered from the . /// - event OnGameObjectUnRegisteredDelegate? OnGameObjectUnRegistered; + event OnGameObjectUnRegisteredEventHandler? OnGameObjectUnRegistered; /// /// Event triggered when a is registered to the . /// - event OnHierarchyObjectRegisteredDelegate? OnHierarchyObjectRegistered; + event OnHierarchyObjectRegisteredEventHandler? OnHierarchyObjectRegistered; /// /// Event triggered when a is unregistered from the . /// - event OnHierarchyObjectUnRegisteredDelegate? OnHierarchyObjectUnRegistered; + event OnHierarchyObjectUnRegisteredEventHandler? OnHierarchyObjectUnRegistered; /// /// Gets a read-only list of s managed by the . @@ -78,11 +78,11 @@ public interface IGameManager : IEntity /// void PreDraw(); - delegate void OnUpdateDelegate(IGameManager sender, EngineTime time); - delegate void OnPreDawDelegate(IGameManager sender); + delegate void OnUpdateEventHandler(IGameManager sender, EngineTime time); + delegate void OnPreDawEventHandler(IGameManager sender); - delegate void OnGameObjectRegisteredDelegate(IGameManager sender, IGameObject gameObjectRegistered); - delegate void OnGameObjectUnRegisteredDelegate(IGameManager sender, IGameObject gameObjectUnregistered); - delegate void OnHierarchyObjectRegisteredDelegate(IGameManager sender, IHierarchyObject hierarchyObjectRegistered); - delegate void OnHierarchyObjectUnRegisteredDelegate(IGameManager sender, IHierarchyObject hierarchyObjectUnregistered); + delegate void OnGameObjectRegisteredEventHandler(IGameManager sender, IGameObject gameObjectRegistered); + delegate void OnGameObjectUnRegisteredEventHandler(IGameManager sender, IGameObject gameObjectUnregistered); + delegate void OnHierarchyObjectRegisteredEventHandler(IGameManager sender, IHierarchyObject hierarchyObjectRegistered); + delegate void OnHierarchyObjectUnRegisteredEventHandler(IGameManager sender, IHierarchyObject hierarchyObjectUnregistered); } diff --git a/Engine.Core/Abstract/IGameObject.cs b/Engine.Core/Abstract/IGameObject.cs index 8e9256f..03b187d 100644 --- a/Engine.Core/Abstract/IGameObject.cs +++ b/Engine.Core/Abstract/IGameObject.cs @@ -8,12 +8,12 @@ public interface IGameObject : IEntity, IHierarchyObject, IAssignableTransform, /// /// Event triggered when the method is called. /// - event OnUpdatedDelegate? OnUpdated; + event OnUpdatedEventHandler? OnUpdated; /// /// Updates the game object. /// void Update(); - delegate void OnUpdatedDelegate(IGameObject sender); + delegate void OnUpdatedEventHandler(IGameObject sender); } diff --git a/Engine.Core/Abstract/IInitialize.cs b/Engine.Core/Abstract/IInitialize.cs index e048eb1..d4487c7 100644 --- a/Engine.Core/Abstract/IInitialize.cs +++ b/Engine.Core/Abstract/IInitialize.cs @@ -8,12 +8,12 @@ public interface IInitialize /// /// Event triggered when the method is called successfully. /// - event OnInitializedDelegate? OnInitialized; + event OnInitializedEventHandler? OnInitialized; /// /// Event triggered when the method is called successfully. /// - event OnFinalizedDelegate? OnFinalized; + event OnFinalizedEventHandler? OnFinalized; /// /// The value indicating whether the entity has been initialized. @@ -32,6 +32,6 @@ public interface IInitialize /// if finalization is successful, otherwise . bool Finalize(); - delegate void OnInitializedDelegate(IInitialize sender); - delegate void OnFinalizedDelegate(IInitialize sender); + delegate void OnInitializedEventHandler(IInitialize sender); + delegate void OnFinalizedEventHandler(IInitialize sender); } diff --git a/Engine.Core/Abstract/INameable.cs b/Engine.Core/Abstract/INameable.cs index 2405b0d..202cc49 100644 --- a/Engine.Core/Abstract/INameable.cs +++ b/Engine.Core/Abstract/INameable.cs @@ -8,12 +8,12 @@ public interface INameable /// /// Event triggered when the name of the entity changes. /// - event OnNameChangedDelegate? OnNameChanged; + event OnNameChangedEventHandler? OnNameChanged; /// /// The name of the entity. /// string Name { get; set; } - delegate void OnNameChangedDelegate(INameable sender, string previousName); + delegate void OnNameChangedEventHandler(INameable sender, string previousName); } diff --git a/Engine.Core/Abstract/IStateEnable.cs b/Engine.Core/Abstract/IStateEnable.cs index 3de5a0c..8591eb4 100644 --- a/Engine.Core/Abstract/IStateEnable.cs +++ b/Engine.Core/Abstract/IStateEnable.cs @@ -8,12 +8,12 @@ public interface IStateEnable : IAssignableEntity /// /// Event triggered when the state of the changes. /// - event OnNameChangedDelegate? OnEnabledChanged; + event OnNameChangedEventHandler? OnEnabledChanged; /// /// The value indicating whether the is enabled. /// bool Enabled { get; set; } - delegate void OnNameChangedDelegate(IStateEnable sender, bool previousState); + delegate void OnNameChangedEventHandler(IStateEnable sender, bool previousState); } diff --git a/Engine.Core/Abstract/ITransform.cs b/Engine.Core/Abstract/ITransform.cs index 5069368..7254020 100644 --- a/Engine.Core/Abstract/ITransform.cs +++ b/Engine.Core/Abstract/ITransform.cs @@ -11,32 +11,32 @@ public interface ITransform : IAssignableGameObject, IEnumerable /// /// Event triggered when the of the changes. /// - event OnPositionChangedDelegate? OnPositionChanged; + event OnPositionChangedEventHandler? OnPositionChanged; /// /// Event triggered when the of the changes. /// - event OnScaleChangedDelegate? OnScaleChanged; + event OnScaleChangedEventHandler? OnScaleChanged; /// /// Event triggered when the of the changes. /// - event OnRotationChangedDelegate? OnRotationChanged; + event OnRotationChangedEventHandler? OnRotationChanged; /// /// Event triggered when the of the changes. The second parameter is the old . /// - event OnParentChangedDelegate? OnParentChanged; + event OnParentChangedEventHandler? OnParentChanged; /// /// Event triggered when a new is added to the . /// - event OnChildrenAddedDelegate? OnChildrenAdded; + event OnChildrenAddedEventHandler? OnChildrenAdded; /// /// Event triggered when an is removed from the . /// - event OnChildrenRemovedDelegate? OnChildrenRemoved; + event OnChildrenRemovedEventHandler? OnChildrenRemoved; /// /// The world position of the in 2D space. @@ -96,10 +96,10 @@ public interface ITransform : IAssignableGameObject, IEnumerable /// The child to remove. void RemoveChild(ITransform transform); - delegate void OnPositionChangedDelegate(ITransform sender); - delegate void OnScaleChangedDelegate(ITransform sender); - delegate void OnRotationChangedDelegate(ITransform sender); - delegate void OnParentChangedDelegate(ITransform sender, ITransform? previousParent, ITransform? newParent); - delegate void OnChildrenAddedDelegate(ITransform sender, ITransform childrenAdded); - delegate void OnChildrenRemovedDelegate(ITransform sender, ITransform childrenRemoved); + delegate void OnPositionChangedEventHandler(ITransform sender); + delegate void OnScaleChangedEventHandler(ITransform sender); + delegate void OnRotationChangedEventHandler(ITransform sender); + delegate void OnParentChangedEventHandler(ITransform sender, ITransform? previousParent, ITransform? newParent); + delegate void OnChildrenAddedEventHandler(ITransform sender, ITransform childrenAdded); + delegate void OnChildrenRemovedEventHandler(ITransform sender, ITransform childrenRemoved); } diff --git a/Engine.Core/BehaviourBase.cs b/Engine.Core/BehaviourBase.cs index 35054ba..6f1872f 100644 --- a/Engine.Core/BehaviourBase.cs +++ b/Engine.Core/BehaviourBase.cs @@ -6,9 +6,9 @@ namespace Syntriax.Engine.Core; [System.Diagnostics.DebuggerDisplay("{GetType().Name, nq}, Priority: {Priority}, Initialized: {Initialized}")] public abstract class BehaviourBase : BaseEntity, IBehaviour { - public event IAssignableBehaviourController.OnBehaviourControllerAssignedDelegate? OnBehaviourControllerAssigned = null; + public event IAssignableBehaviourController.OnBehaviourControllerAssignedEventHandler? OnBehaviourControllerAssigned = null; - public event IBehaviour.OnPriorityChangedDelegate? OnPriorityChanged = null; + public event IBehaviour.OnPriorityChangedEventHandler? OnPriorityChanged = null; private IBehaviourController _behaviourController = null!; diff --git a/Engine.Core/BehaviourCollector.cs b/Engine.Core/BehaviourCollector.cs index 2ab3a27..df6c7b6 100644 --- a/Engine.Core/BehaviourCollector.cs +++ b/Engine.Core/BehaviourCollector.cs @@ -8,11 +8,11 @@ namespace Syntriax.Engine.Core; public class BehaviourCollector : IAssignableGameManager, IEnumerable { - public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; - public event IAssignableGameManager.OnGameManagerAssignedDelegate? OnGameManagerAssigned = null; + public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null; + public event IAssignableGameManager.OnGameManagerAssignedEventHandler? OnGameManagerAssigned = null; - public event OnCollectedDelegate? OnCollected = null; - public event OnRemovedDelegate? OnRemoved = null; + public event OnCollectedEventHandler? OnCollected = null; + public event OnRemovedEventHandler? OnRemoved = null; private readonly List _behaviours = new(32); @@ -99,6 +99,6 @@ public class BehaviourCollector : IAssignableGameManager, IEnumerable IEnumerator IEnumerable.GetEnumerator() => _behaviours.GetEnumerator(); - public delegate void OnCollectedDelegate(BehaviourCollector sender, T behaviourCollected); - public delegate void OnRemovedDelegate(BehaviourCollector sender, T behaviourRemoved); + public delegate void OnCollectedEventHandler(BehaviourCollector sender, T behaviourCollected); + public delegate void OnRemovedEventHandler(BehaviourCollector sender, T behaviourRemoved); } diff --git a/Engine.Core/BehaviourController.cs b/Engine.Core/BehaviourController.cs index 80e890f..de5dfb6 100644 --- a/Engine.Core/BehaviourController.cs +++ b/Engine.Core/BehaviourController.cs @@ -12,18 +12,18 @@ namespace Syntriax.Engine.Core; [System.Diagnostics.DebuggerDisplay("Behaviour Count: {behaviours.Count}")] public class BehaviourController : IBehaviourController { - public event IBehaviourController.OnPreUpdateDelegate? OnPreUpdate = null; - public event IBehaviourController.OnUpdateDelegate? OnUpdate = null; - public event IBehaviourController.OnPreDrawDelegate? OnPreDraw = null; + public event IBehaviourController.OnPreUpdateEventHandler? OnPreUpdate = null; + public event IBehaviourController.OnUpdateEventHandler? OnUpdate = null; + public event IBehaviourController.OnPreDrawEventHandler? OnPreDraw = null; - public event IBehaviourController.OnBehaviourAddedDelegate? OnBehaviourAdded = null; - public event IBehaviourController.OnBehaviourRemovedDelegate? OnBehaviourRemoved = null; - public event IAssignableGameObject.OnGameObjectAssignedDelegate? OnGameObjectAssigned = null; + public event IBehaviourController.OnBehaviourAddedEventHandler? OnBehaviourAdded = null; + public event IBehaviourController.OnBehaviourRemovedEventHandler? OnBehaviourRemoved = null; + public event IAssignableGameObject.OnGameObjectAssignedEventHandler? OnGameObjectAssigned = null; - public event IInitialize.OnInitializedDelegate? OnInitialized = null; - public event IInitialize.OnFinalizedDelegate? OnFinalized = null; + public event IInitialize.OnInitializedEventHandler? OnInitialized = null; + public event IInitialize.OnFinalizedEventHandler? OnFinalized = null; - public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; + public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null; private readonly IList behaviours = new List(Constants.BEHAVIOURS_SIZE_INITIAL); diff --git a/Engine.Core/GameManager.cs b/Engine.Core/GameManager.cs index 3f118fa..0438c81 100644 --- a/Engine.Core/GameManager.cs +++ b/Engine.Core/GameManager.cs @@ -11,13 +11,13 @@ namespace Syntriax.Engine.Core; [System.Diagnostics.DebuggerDisplay("GameObject Count: {_gameObjects.Count}")] public class GameManager : BaseEntity, IGameManager { - public event IGameManager.OnUpdateDelegate? OnUpdate = null; - public event IGameManager.OnPreDawDelegate? OnPreDraw = null; + public event IGameManager.OnUpdateEventHandler? OnUpdate = null; + public event IGameManager.OnPreDawEventHandler? OnPreDraw = null; - public event IGameManager.OnGameObjectRegisteredDelegate? OnGameObjectRegistered = null; - public event IGameManager.OnGameObjectUnRegisteredDelegate? OnGameObjectUnRegistered = null; - public event IGameManager.OnHierarchyObjectRegisteredDelegate? OnHierarchyObjectRegistered = null; - public event IGameManager.OnHierarchyObjectUnRegisteredDelegate? OnHierarchyObjectUnRegistered = null; + public event IGameManager.OnGameObjectRegisteredEventHandler? OnGameObjectRegistered = null; + public event IGameManager.OnGameObjectUnRegisteredEventHandler? OnGameObjectUnRegistered = null; + public event IGameManager.OnHierarchyObjectRegisteredEventHandler? OnHierarchyObjectRegistered = null; + public event IGameManager.OnHierarchyObjectUnRegisteredEventHandler? OnHierarchyObjectUnRegistered = null; private readonly List _gameObjects = new(Constants.GAME_OBJECTS_SIZE_INITIAL); private readonly List _hierarchyObjects = new(Constants.GAME_OBJECTS_SIZE_INITIAL); diff --git a/Engine.Core/GameObject.cs b/Engine.Core/GameObject.cs index 8f2a9af..fcb4a91 100644 --- a/Engine.Core/GameObject.cs +++ b/Engine.Core/GameObject.cs @@ -6,15 +6,15 @@ namespace Syntriax.Engine.Core; [System.Diagnostics.DebuggerDisplay("Name: {Name}, Initialized: {Initialized}")] public class GameObject : BaseEntity, IGameObject { - public event IHierarchyObject.OnEnteredHierarchyDelegate? OnEnteredHierarchy = null; - public event IHierarchyObject.OnExitedHierarchyDelegate? OnExitedHierarchy = null; + public event IHierarchyObject.OnEnteredHierarchyEventHandler? OnEnteredHierarchy = null; + public event IHierarchyObject.OnExitedHierarchyEventHandler? OnExitedHierarchy = null; - public event IAssignableTransform.OnTransformAssignedDelegate? OnTransformAssigned = null; - public event IAssignableBehaviourController.OnBehaviourControllerAssignedDelegate? OnBehaviourControllerAssigned = null; + public event IAssignableTransform.OnTransformAssignedEventHandler? OnTransformAssigned = null; + public event IAssignableBehaviourController.OnBehaviourControllerAssignedEventHandler? OnBehaviourControllerAssigned = null; - public event INameable.OnNameChangedDelegate? OnNameChanged = null; + public event INameable.OnNameChangedEventHandler? OnNameChanged = null; - public event IGameObject.OnUpdatedDelegate? OnUpdated = null; + public event IGameObject.OnUpdatedEventHandler? OnUpdated = null; private ITransform _transform = null!; private IBehaviourController _behaviourController = null!; diff --git a/Engine.Core/HierarchyObjectBase.cs b/Engine.Core/HierarchyObjectBase.cs index 2a6f338..0807a81 100644 --- a/Engine.Core/HierarchyObjectBase.cs +++ b/Engine.Core/HierarchyObjectBase.cs @@ -4,14 +4,14 @@ namespace Syntriax.Engine.Core; public abstract class HierarchyObjectBase : IHierarchyObject { - public event IHierarchyObject.OnEnteredHierarchyDelegate? OnEnteredHierarchy = null; - public event IHierarchyObject.OnExitedHierarchyDelegate? OnExitedHierarchy = null; - public event IEntity.OnIdChangedDelegate? OnIdChanged = null; - public event IInitialize.OnInitializedDelegate? OnInitialized = null; - public event IInitialize.OnFinalizedDelegate? OnFinalized = null; - public event IAssignableStateEnable.OnStateEnableAssignedDelegate? OnStateEnableAssigned = null; - public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; - public event INameable.OnNameChangedDelegate? OnNameChanged = null; + public event IHierarchyObject.OnEnteredHierarchyEventHandler? OnEnteredHierarchy = null; + public event IHierarchyObject.OnExitedHierarchyEventHandler? OnExitedHierarchy = null; + public event IEntity.OnIdChangedEventHandler? OnIdChanged = null; + public event IInitialize.OnInitializedEventHandler? OnInitialized = null; + public event IInitialize.OnFinalizedEventHandler? OnFinalized = null; + public event IAssignableStateEnable.OnStateEnableAssignedEventHandler? OnStateEnableAssigned = null; + public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null; + public event INameable.OnNameChangedEventHandler? OnNameChanged = null; private string _id = string.Empty; private string _name = nameof(HierarchyObjectBase); diff --git a/Engine.Core/StateEnable.cs b/Engine.Core/StateEnable.cs index 24e522e..3451fbb 100644 --- a/Engine.Core/StateEnable.cs +++ b/Engine.Core/StateEnable.cs @@ -4,9 +4,9 @@ namespace Syntriax.Engine.Core; public class StateEnable : IStateEnable { - public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; - public event IAssignableEntity.OnEntityAssignedDelegate? OnEntityAssigned = null; - public event IStateEnable.OnNameChangedDelegate? OnEnabledChanged = null; + public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null; + public event IAssignableEntity.OnEntityAssignedEventHandler? OnEntityAssigned = null; + public event IStateEnable.OnNameChangedEventHandler? OnEnabledChanged = null; private bool _enabled = true; private IEntity _entity = null!; diff --git a/Engine.Core/Transform.cs b/Engine.Core/Transform.cs index 654c91a..3603d28 100644 --- a/Engine.Core/Transform.cs +++ b/Engine.Core/Transform.cs @@ -8,17 +8,17 @@ namespace Syntriax.Engine.Core; [System.Diagnostics.DebuggerDisplay("Name: {GameObject.Name, nq} Position: {Position.ToString(), nq}, Scale: {Scale.ToString(), nq}, Rotation: {Rotation}")] public class Transform : ITransform { - public event IAssignableGameObject.OnGameObjectAssignedDelegate? OnGameObjectAssigned = null; + public event IAssignableGameObject.OnGameObjectAssignedEventHandler? OnGameObjectAssigned = null; - public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; + public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null; - public event ITransform.OnPositionChangedDelegate? OnPositionChanged = null; - public event ITransform.OnScaleChangedDelegate? OnScaleChanged = null; - public event ITransform.OnRotationChangedDelegate? OnRotationChanged = null; + public event ITransform.OnPositionChangedEventHandler? OnPositionChanged = null; + public event ITransform.OnScaleChangedEventHandler? OnScaleChanged = null; + public event ITransform.OnRotationChangedEventHandler? OnRotationChanged = null; - public event ITransform.OnParentChangedDelegate? OnParentChanged = null; - public event ITransform.OnChildrenAddedDelegate? OnChildrenAdded = null; - public event ITransform.OnChildrenRemovedDelegate? OnChildrenRemoved = null; + public event ITransform.OnParentChangedEventHandler? OnParentChanged = null; + public event ITransform.OnChildrenAddedEventHandler? OnChildrenAdded = null; + public event ITransform.OnChildrenRemovedEventHandler? OnChildrenRemoved = null; private Vector2D _position = Vector2D.Zero; diff --git a/Engine.Input/Abstract/IButtonInputs.cs b/Engine.Input/Abstract/IButtonInputs.cs index 634bd91..59ab741 100644 --- a/Engine.Input/Abstract/IButtonInputs.cs +++ b/Engine.Input/Abstract/IButtonInputs.cs @@ -4,12 +4,12 @@ namespace Syntriax.Engine.Input; public interface IButtonInputs : IAssignableStateEnable { - void RegisterOnPress(T button, ButtonCallbackDelegate callback); - void UnregisterOnPress(T button, ButtonCallbackDelegate callback); - void RegisterOnRelease(T button, ButtonCallbackDelegate callback); - void UnregisterOnRelease(T button, ButtonCallbackDelegate callback); + void RegisterOnPress(T button, ButtonCallbackEventHandler callback); + void UnregisterOnPress(T button, ButtonCallbackEventHandler callback); + void RegisterOnRelease(T button, ButtonCallbackEventHandler callback); + void UnregisterOnRelease(T button, ButtonCallbackEventHandler callback); bool IsPressed(T button); - delegate void ButtonCallbackDelegate(IButtonInputs buttonInputs, T button); + delegate void ButtonCallbackEventHandler(IButtonInputs buttonInputs, T button); } diff --git a/Engine.Physics2D/Abstract/ICollider2D.cs b/Engine.Physics2D/Abstract/ICollider2D.cs index d989f0e..be6baf6 100644 --- a/Engine.Physics2D/Abstract/ICollider2D.cs +++ b/Engine.Physics2D/Abstract/ICollider2D.cs @@ -10,17 +10,17 @@ public interface ICollider2D : IBehaviour, IAssignableTransform /// /// Event triggered when a collision is detected. /// - event OnCollisionDetectedDelegate? OnCollisionDetected; + event OnCollisionDetectedEventHandler? OnCollisionDetected; /// /// Event triggered when a collision is resolved. /// - event OnCollisionResolvedDelegate? OnCollisionResolved; + event OnCollisionResolvedEventHandler? OnCollisionResolved; /// /// Event triggered when another triggers this . /// - event OnTriggeredDelegate? OnTriggered; + event OnTriggeredEventHandler? OnTriggered; /// /// The associated with the . @@ -41,7 +41,7 @@ public interface ICollider2D : IBehaviour, IAssignableTransform void Resolve(CollisionDetectionInformation collisionDetectionInformation); void Trigger(ICollider2D initiator); - delegate void OnCollisionDetectedDelegate(ICollider2D sender, CollisionDetectionInformation collisionDetectionInformation); - delegate void OnCollisionResolvedDelegate(ICollider2D sender, CollisionDetectionInformation collisionDetectionInformation); - delegate void OnTriggeredDelegate(ICollider2D sender, ICollider2D initiatorCollider); + delegate void OnCollisionDetectedEventHandler(ICollider2D sender, CollisionDetectionInformation collisionDetectionInformation); + delegate void OnCollisionResolvedEventHandler(ICollider2D sender, CollisionDetectionInformation collisionDetectionInformation); + delegate void OnTriggeredEventHandler(ICollider2D sender, ICollider2D initiatorCollider); } diff --git a/Engine.Physics2D/Abstract/IPhysicsEngine2D.cs b/Engine.Physics2D/Abstract/IPhysicsEngine2D.cs index cd54c09..512593c 100644 --- a/Engine.Physics2D/Abstract/IPhysicsEngine2D.cs +++ b/Engine.Physics2D/Abstract/IPhysicsEngine2D.cs @@ -8,12 +8,12 @@ public interface IPhysicsEngine2D /// /// Event triggered when the has done a single physics iteration. /// - event OnPhysicsIterationDelegate? OnPhysicsIteration; + event OnPhysicsIterationEventHandler? OnPhysicsIteration; /// /// Event triggered when the has done a full physics step/>. /// - event OnPhysicsStepDelegate? OnPhysicsStep; + event OnPhysicsStepEventHandler? OnPhysicsStep; /// /// The number of iterations the performs per step. @@ -26,6 +26,6 @@ public interface IPhysicsEngine2D /// The time step. void Step(float deltaTime); - delegate void OnPhysicsIterationDelegate(IPhysicsEngine2D sender, float iterationDeltaTime); - delegate void OnPhysicsStepDelegate(IPhysicsEngine2D sender, float stepDeltaTime); + delegate void OnPhysicsIterationEventHandler(IPhysicsEngine2D sender, float iterationDeltaTime); + delegate void OnPhysicsStepEventHandler(IPhysicsEngine2D sender, float stepDeltaTime); } diff --git a/Engine.Physics2D/Collider2DBehaviourBase.cs b/Engine.Physics2D/Collider2DBehaviourBase.cs index 7764132..82abd91 100644 --- a/Engine.Physics2D/Collider2DBehaviourBase.cs +++ b/Engine.Physics2D/Collider2DBehaviourBase.cs @@ -6,9 +6,9 @@ namespace Syntriax.Engine.Physics2D; public abstract class Collider2DBehaviourBase : Behaviour, ICollider2D { - public event ICollider2D.OnCollisionDetectedDelegate? OnCollisionDetected = null; - public event ICollider2D.OnCollisionResolvedDelegate? OnCollisionResolved = null; - public event ICollider2D.OnTriggeredDelegate? OnTriggered = null; + public event ICollider2D.OnCollisionDetectedEventHandler? OnCollisionDetected = null; + public event ICollider2D.OnCollisionResolvedEventHandler? OnCollisionResolved = null; + public event ICollider2D.OnTriggeredEventHandler? OnTriggered = null; protected bool NeedsRecalculation { get; private set; } = true; @@ -18,7 +18,7 @@ public abstract class Collider2DBehaviourBase : Behaviour, ICollider2D public bool IsTrigger { get; set; } = false; ITransform IAssignableTransform.Transform => Transform; - public event IAssignableTransform.OnTransformAssignedDelegate? OnTransformAssigned { add => GameObject.OnTransformAssigned += value; remove => GameObject.OnTransformAssigned -= value; } + public event IAssignableTransform.OnTransformAssignedEventHandler? OnTransformAssigned { add => GameObject.OnTransformAssigned += value; remove => GameObject.OnTransformAssigned -= value; } bool IAssignableTransform.Assign(ITransform transform) => GameObject.Assign(transform); diff --git a/Engine.Physics2D/PhysicsEngine2D.cs b/Engine.Physics2D/PhysicsEngine2D.cs index 7a5b8f2..38823a8 100644 --- a/Engine.Physics2D/PhysicsEngine2D.cs +++ b/Engine.Physics2D/PhysicsEngine2D.cs @@ -7,8 +7,8 @@ namespace Syntriax.Engine.Physics2D; public class PhysicsEngine2D : IPhysicsEngine2D { - public event IPhysicsEngine2D.OnPhysicsIterationDelegate? OnPhysicsIteration = null; - public event IPhysicsEngine2D.OnPhysicsStepDelegate? OnPhysicsStep = null; + public event IPhysicsEngine2D.OnPhysicsIterationEventHandler? OnPhysicsIteration = null; + public event IPhysicsEngine2D.OnPhysicsStepEventHandler? OnPhysicsStep = null; private readonly List rigidBodies = new(32); private readonly List colliders = new(64); diff --git a/Engine.Physics2D/PhysicsEngine2DCollector.cs b/Engine.Physics2D/PhysicsEngine2DCollector.cs index 886cdc4..64154a2 100644 --- a/Engine.Physics2D/PhysicsEngine2DCollector.cs +++ b/Engine.Physics2D/PhysicsEngine2DCollector.cs @@ -6,8 +6,8 @@ namespace Syntriax.Engine.Physics2D; public class PhysicsEngine2DCollector : HierarchyObjectBase, IPhysicsEngine2D { - public event IPhysicsEngine2D.OnPhysicsIterationDelegate? OnPhysicsIteration = null; - public event IPhysicsEngine2D.OnPhysicsStepDelegate? OnPhysicsStep = null; + public event IPhysicsEngine2D.OnPhysicsIterationEventHandler? OnPhysicsIteration = null; + public event IPhysicsEngine2D.OnPhysicsStepEventHandler? OnPhysicsStep = null; private int _iterationPerStep = 1; diff --git a/Engine.Physics2D/RigidBody2D.cs b/Engine.Physics2D/RigidBody2D.cs index 08a6b02..f53180e 100644 --- a/Engine.Physics2D/RigidBody2D.cs +++ b/Engine.Physics2D/RigidBody2D.cs @@ -6,7 +6,7 @@ namespace Syntriax.Engine.Physics2D; public class RigidBody2D : Behaviour, IRigidBody2D { - event IAssignableTransform.OnTransformAssignedDelegate? IAssignableTransform.OnTransformAssigned { add => GameObject.OnTransformAssigned += value; remove => GameObject.OnTransformAssigned -= value; } + event IAssignableTransform.OnTransformAssignedEventHandler? IAssignableTransform.OnTransformAssigned { add => GameObject.OnTransformAssigned += value; remove => GameObject.OnTransformAssigned -= value; } private const float LOWEST_ALLOWED_MASS = 0.00001f; private float _mass = 1f;