refactor: Renamed Delegate Declarations as EventHandler

This commit is contained in:
Syntriax 2024-11-23 23:14:44 +03:00
parent 981db0190f
commit e725a4e89c
33 changed files with 145 additions and 145 deletions

View File

@ -8,7 +8,7 @@ public interface IAssignable
/// <summary> /// <summary>
/// Event triggered when the <see cref="IAssignable"/>'s fields are unassigned and completely ready to recycle. /// Event triggered when the <see cref="IAssignable"/>'s fields are unassigned and completely ready to recycle.
/// </summary> /// </summary>
event OnUnassignedDelegate? OnUnassigned; event OnUnassignedEventHandler? OnUnassigned;
/// <summary> /// <summary>
/// Unassign <see cref="IAssignable"/>'s all fields and make it ready to recycle. /// Unassign <see cref="IAssignable"/>'s all fields and make it ready to recycle.
@ -18,5 +18,5 @@ public interface IAssignable
/// </returns> /// </returns>
bool Unassign(); bool Unassign();
delegate void OnUnassignedDelegate(IAssignable sender); delegate void OnUnassignedEventHandler(IAssignable sender);
} }

View File

@ -8,7 +8,7 @@ public interface IAssignableBehaviourController : IAssignable
/// <summary> /// <summary>
/// Event triggered when the <see cref="IBehaviourController"/> value has has been assigned a new value. /// Event triggered when the <see cref="IBehaviourController"/> value has has been assigned a new value.
/// </summary> /// </summary>
event OnBehaviourControllerAssignedDelegate? OnBehaviourControllerAssigned; event OnBehaviourControllerAssignedEventHandler? OnBehaviourControllerAssigned;
/// <inheritdoc cref="IBehaviourController" /> /// <inheritdoc cref="IBehaviourController" />
IBehaviourController BehaviourController { get; } IBehaviourController BehaviourController { get; }
@ -22,5 +22,5 @@ public interface IAssignableBehaviourController : IAssignable
/// </returns> /// </returns>
bool Assign(IBehaviourController behaviourController); bool Assign(IBehaviourController behaviourController);
delegate void OnBehaviourControllerAssignedDelegate(IAssignableBehaviourController sender); delegate void OnBehaviourControllerAssignedEventHandler(IAssignableBehaviourController sender);
} }

View File

@ -8,7 +8,7 @@ public interface IAssignableEntity : IAssignable
/// <summary> /// <summary>
/// Event triggered when the <see cref="IEntity"/> value has has been assigned a new value. /// Event triggered when the <see cref="IEntity"/> value has has been assigned a new value.
/// </summary> /// </summary>
event OnEntityAssignedDelegate? OnEntityAssigned; event OnEntityAssignedEventHandler? OnEntityAssigned;
/// <inheritdoc cref="IEntity" /> /// <inheritdoc cref="IEntity" />
IEntity Entity { get; } IEntity Entity { get; }
@ -22,5 +22,5 @@ public interface IAssignableEntity : IAssignable
/// </returns> /// </returns>
bool Assign(IEntity entity); bool Assign(IEntity entity);
delegate void OnEntityAssignedDelegate(IAssignableEntity sender); delegate void OnEntityAssignedEventHandler(IAssignableEntity sender);
} }

View File

@ -8,7 +8,7 @@ public interface IAssignableGameManager : IAssignable
/// <summary> /// <summary>
/// Event triggered when the <see cref="IGameManager"/> value has has been assigned a new value. /// Event triggered when the <see cref="IGameManager"/> value has has been assigned a new value.
/// </summary> /// </summary>
event OnGameManagerAssignedDelegate? OnGameManagerAssigned; event OnGameManagerAssignedEventHandler? OnGameManagerAssigned;
/// <inheritdoc cref="IGameManager" /> /// <inheritdoc cref="IGameManager" />
IGameManager GameManager { get; } IGameManager GameManager { get; }
@ -22,5 +22,5 @@ public interface IAssignableGameManager : IAssignable
/// </returns> /// </returns>
bool Assign(IGameManager gameManager); bool Assign(IGameManager gameManager);
delegate void OnGameManagerAssignedDelegate(IAssignableGameManager sender); delegate void OnGameManagerAssignedEventHandler(IAssignableGameManager sender);
} }

View File

@ -8,7 +8,7 @@ public interface IAssignableGameObject : IAssignable
/// <summary> /// <summary>
/// Event triggered when the <see cref="IGameObject"/> value has has been assigned a new value. /// Event triggered when the <see cref="IGameObject"/> value has has been assigned a new value.
/// </summary> /// </summary>
event OnGameObjectAssignedDelegate? OnGameObjectAssigned; event OnGameObjectAssignedEventHandler? OnGameObjectAssigned;
/// <inheritdoc cref="IGameObject" /> /// <inheritdoc cref="IGameObject" />
IGameObject GameObject { get; } IGameObject GameObject { get; }
@ -22,5 +22,5 @@ public interface IAssignableGameObject : IAssignable
/// </returns> /// </returns>
bool Assign(IGameObject gameObject); bool Assign(IGameObject gameObject);
delegate void OnGameObjectAssignedDelegate(IAssignableGameObject sender); delegate void OnGameObjectAssignedEventHandler(IAssignableGameObject sender);
} }

View File

@ -8,7 +8,7 @@ public interface IAssignableStateEnable : IAssignable
/// <summary> /// <summary>
/// Event triggered when the <see cref="IStateEnable"/> value has has been assigned a new value. /// Event triggered when the <see cref="IStateEnable"/> value has has been assigned a new value.
/// </summary> /// </summary>
event OnStateEnableAssignedDelegate? OnStateEnableAssigned; event OnStateEnableAssignedEventHandler? OnStateEnableAssigned;
/// <inheritdoc cref="IStateEnable" /> /// <inheritdoc cref="IStateEnable" />
IStateEnable StateEnable { get; } IStateEnable StateEnable { get; }
@ -22,5 +22,5 @@ public interface IAssignableStateEnable : IAssignable
/// </returns> /// </returns>
bool Assign(IStateEnable stateEnable); bool Assign(IStateEnable stateEnable);
delegate void OnStateEnableAssignedDelegate(IAssignableStateEnable sender); delegate void OnStateEnableAssignedEventHandler(IAssignableStateEnable sender);
} }

View File

@ -8,7 +8,7 @@ public interface IAssignableTransform : IAssignable
/// <summary> /// <summary>
/// Event triggered when the <see cref="ITransform"/> value has has been assigned a new value. /// Event triggered when the <see cref="ITransform"/> value has has been assigned a new value.
/// </summary> /// </summary>
event OnTransformAssignedDelegate? OnTransformAssigned; event OnTransformAssignedEventHandler? OnTransformAssigned;
/// <inheritdoc cref="ITransform" /> /// <inheritdoc cref="ITransform" />
ITransform Transform { get; } ITransform Transform { get; }
@ -22,5 +22,5 @@ public interface IAssignableTransform : IAssignable
/// </returns> /// </returns>
bool Assign(ITransform transform); bool Assign(ITransform transform);
delegate void OnTransformAssignedDelegate(IAssignableTransform sender); delegate void OnTransformAssignedEventHandler(IAssignableTransform sender);
} }

View File

@ -10,12 +10,12 @@ public interface IHierarchyObject : IEntity, INameable
/// <summary> /// <summary>
/// Event triggered when the <see cref="IEntity"/> enters the hierarchy. /// Event triggered when the <see cref="IEntity"/> enters the hierarchy.
/// </summary> /// </summary>
event OnEnteredHierarchyDelegate? OnEnteredHierarchy; event OnEnteredHierarchyEventHandler? OnEnteredHierarchy;
/// <summary> /// <summary>
/// Event triggered when the <see cref="IEntity"/> exits the hierarchy. /// Event triggered when the <see cref="IEntity"/> exits the hierarchy.
/// </summary> /// </summary>
event OnExitedHierarchyDelegate? OnExitedHierarchy; event OnExitedHierarchyEventHandler? OnExitedHierarchy;
/// <summary> /// <summary>
/// Gets the <see cref="IGameManager"/> associated with this <see cref="IEntity"/> , if any. /// Gets the <see cref="IGameManager"/> associated with this <see cref="IEntity"/> , if any.
@ -49,16 +49,16 @@ public interface IHierarchyObject : IEntity, INameable
internal bool ExitHierarchy(); internal bool ExitHierarchy();
/// <summary> /// <summary>
/// Delegate type for the event triggered when the <see cref="IEntity"/> enters the hierarchy of a <see cref="IGameManager">. /// EventHandler delegate for the event triggered when the <see cref="IEntity"/> enters the hierarchy of a <see cref="IGameManager">.
/// </summary> /// </summary>
/// <param name="sender">The <see cref="IEntity"/> that entered the hierarchy.</param> /// <param name="sender">The <see cref="IEntity"/> that entered the hierarchy.</param>
/// <param name="gameManager">The <see cref="IGameManager"/> that the <see cref="IEntity"/> has entered it's hierarchy.</param> /// <param name="gameManager">The <see cref="IGameManager"/> that the <see cref="IEntity"/> has entered it's hierarchy.</param>
delegate void OnEnteredHierarchyDelegate(IHierarchyObject sender, IGameManager gameManager); delegate void OnEnteredHierarchyEventHandler(IHierarchyObject sender, IGameManager gameManager);
/// <summary> /// <summary>
/// Delegate type for the event triggered when the <see cref="IEntity"/> exits the hierarchy of a <see cref="IGameManager">. /// EventHandler delegate for the event triggered when the <see cref="IEntity"/> exits the hierarchy of a <see cref="IGameManager">.
/// </summary> /// </summary>
/// <param name="sender">The <see cref="IEntity"/> that exited the hierarchy.</param> /// <param name="sender">The <see cref="IEntity"/> that exited the hierarchy.</param>
/// <param name="gameManager">The <see cref="IGameManager"/> that the <see cref="IEntity"/> has exited it's hierarchy.</param> /// <param name="gameManager">The <see cref="IGameManager"/> that the <see cref="IEntity"/> has exited it's hierarchy.</param>
delegate void OnExitedHierarchyDelegate(IHierarchyObject sender, IGameManager gameManager); delegate void OnExitedHierarchyEventHandler(IHierarchyObject sender, IGameManager gameManager);
} }

View File

@ -6,13 +6,13 @@ namespace Syntriax.Engine.Core.Abstract;
public abstract class BaseEntity : IEntity 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.OnInitializedEventHandler? OnInitialized = null;
public event IInitialize.OnFinalizedDelegate? OnFinalized = null; public event IInitialize.OnFinalizedEventHandler? OnFinalized = null;
public event IAssignableStateEnable.OnStateEnableAssignedDelegate? OnStateEnableAssigned = null; public event IAssignableStateEnable.OnStateEnableAssignedEventHandler? OnStateEnableAssigned = null;
public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null;
private IStateEnable _stateEnable = null!; private IStateEnable _stateEnable = null!;

View File

@ -8,7 +8,7 @@ public interface IBehaviour : IEntity, IAssignableBehaviourController, IAssignab
/// <summary> /// <summary>
/// Event triggered when the priority of the <see cref="IBehaviour"/> changes. /// Event triggered when the priority of the <see cref="IBehaviour"/> changes.
/// </summary> /// </summary>
event OnPriorityChangedDelegate? OnPriorityChanged; event OnPriorityChangedEventHandler? OnPriorityChanged;
/// <summary> /// <summary>
/// The priority of the <see cref="IBehaviour"/>. /// The priority of the <see cref="IBehaviour"/>.
@ -20,5 +20,5 @@ public interface IBehaviour : IEntity, IAssignableBehaviourController, IAssignab
/// </summary> /// </summary>
bool IsActive { get; } bool IsActive { get; }
delegate void OnPriorityChangedDelegate(IBehaviour sender, int previousPriority); delegate void OnPriorityChangedEventHandler(IBehaviour sender, int previousPriority);
} }

View File

@ -11,27 +11,27 @@ public interface IBehaviourController : IInitialize, IAssignableGameObject, IEnu
/// <summary> /// <summary>
/// Event triggered before the update of <see cref="IBehaviour"/>s. /// Event triggered before the update of <see cref="IBehaviour"/>s.
/// </summary> /// </summary>
event OnPreUpdateDelegate? OnPreUpdate; event OnPreUpdateEventHandler? OnPreUpdate;
/// <summary> /// <summary>
/// Event triggered during the update of <see cref="IBehaviour"/>s. /// Event triggered during the update of <see cref="IBehaviour"/>s.
/// </summary> /// </summary>
event OnUpdateDelegate? OnUpdate; event OnUpdateEventHandler? OnUpdate;
/// <summary> /// <summary>
/// Event triggered before the drawing phase. /// Event triggered before the drawing phase.
/// </summary> /// </summary>
event OnPreDrawDelegate? OnPreDraw; event OnPreDrawEventHandler? OnPreDraw;
/// <summary> /// <summary>
/// Event triggered when a <see cref="IBehaviour"/> is added to the <see cref="IBehaviourController"/>. /// Event triggered when a <see cref="IBehaviour"/> is added to the <see cref="IBehaviourController"/>.
/// </summary> /// </summary>
event OnBehaviourAddedDelegate? OnBehaviourAdded; event OnBehaviourAddedEventHandler? OnBehaviourAdded;
/// <summary> /// <summary>
/// Event triggered when a <see cref="IBehaviour"/> is removed from the <see cref="IBehaviourController"/>. /// Event triggered when a <see cref="IBehaviour"/> is removed from the <see cref="IBehaviourController"/>.
/// </summary> /// </summary>
event OnBehaviourRemovedDelegate? OnBehaviourRemoved; event OnBehaviourRemovedEventHandler? OnBehaviourRemoved;
/// <summary> /// <summary>
/// Adds a <see cref="IBehaviour"/> to the <see cref="IBehaviourController"/>. /// Adds a <see cref="IBehaviour"/> to the <see cref="IBehaviourController"/>.
@ -102,10 +102,10 @@ public interface IBehaviourController : IInitialize, IAssignableGameObject, IEnu
/// </summary> /// </summary>
void UpdatePreDraw(); void UpdatePreDraw();
delegate void OnPreUpdateDelegate(IBehaviourController sender); delegate void OnPreUpdateEventHandler(IBehaviourController sender);
delegate void OnUpdateDelegate(IBehaviourController sender); delegate void OnUpdateEventHandler(IBehaviourController sender);
delegate void OnPreDrawDelegate(IBehaviourController sender); delegate void OnPreDrawEventHandler(IBehaviourController sender);
delegate void OnBehaviourAddedDelegate(IBehaviourController sender, IBehaviour behaviourAdded); delegate void OnBehaviourAddedEventHandler(IBehaviourController sender, IBehaviour behaviourAdded);
delegate void OnBehaviourRemovedDelegate(IBehaviourController sender, IBehaviour behaviourRemoved); delegate void OnBehaviourRemovedEventHandler(IBehaviourController sender, IBehaviour behaviourRemoved);
} }

View File

@ -9,12 +9,12 @@ public interface IEntity : IInitialize, IAssignableStateEnable
/// Event triggered when the <see cref="Id"/> of the <see cref="IEntity"/> changes. /// Event triggered when the <see cref="Id"/> of the <see cref="IEntity"/> changes.
/// The string action parameter is the previous <see cref="Id"/> of the <see cref="IEntity"/>. /// The string action parameter is the previous <see cref="Id"/> of the <see cref="IEntity"/>.
/// </summary> /// </summary>
event OnIdChangedDelegate? OnIdChanged; event OnIdChangedEventHandler? OnIdChanged;
/// <summary> /// <summary>
/// The ID of the <see cref="IEntity"/>. /// The ID of the <see cref="IEntity"/>.
/// </summary> /// </summary>
string Id { get; set; } string Id { get; set; }
delegate void OnIdChangedDelegate(IEntity sender, string previousId); delegate void OnIdChangedEventHandler(IEntity sender, string previousId);
} }

View File

@ -10,32 +10,32 @@ public interface IGameManager : IEntity
/// <summary> /// <summary>
/// Event triggered when <see cref="Update(EngineTime)"/> is called on the <see cref="IGameManager"/>. /// Event triggered when <see cref="Update(EngineTime)"/> is called on the <see cref="IGameManager"/>.
/// </summary> /// </summary>
event OnUpdateDelegate? OnUpdate; event OnUpdateEventHandler? OnUpdate;
/// <summary> /// <summary>
/// Event triggered when <see cref="PreDraw"/> is called on the <see cref="IGameManager"/>. /// Event triggered when <see cref="PreDraw"/> is called on the <see cref="IGameManager"/>.
/// </summary> /// </summary>
event OnPreDawDelegate? OnPreDraw; event OnPreDawEventHandler? OnPreDraw;
/// <summary> /// <summary>
/// Event triggered when a <see cref="IGameObject"/> is registered to the <see cref="IGameManager"/>. /// Event triggered when a <see cref="IGameObject"/> is registered to the <see cref="IGameManager"/>.
/// </summary> /// </summary>
event OnGameObjectRegisteredDelegate? OnGameObjectRegistered; event OnGameObjectRegisteredEventHandler? OnGameObjectRegistered;
/// <summary> /// <summary>
/// Event triggered when a <see cref="IGameObject"/> is unregistered from the <see cref="IGameManager"/>. /// Event triggered when a <see cref="IGameObject"/> is unregistered from the <see cref="IGameManager"/>.
/// </summary> /// </summary>
event OnGameObjectUnRegisteredDelegate? OnGameObjectUnRegistered; event OnGameObjectUnRegisteredEventHandler? OnGameObjectUnRegistered;
/// <summary> /// <summary>
/// Event triggered when a <see cref="IHierarchyObject"/> is registered to the <see cref="IGameManager"/>. /// Event triggered when a <see cref="IHierarchyObject"/> is registered to the <see cref="IGameManager"/>.
/// </summary> /// </summary>
event OnHierarchyObjectRegisteredDelegate? OnHierarchyObjectRegistered; event OnHierarchyObjectRegisteredEventHandler? OnHierarchyObjectRegistered;
/// <summary> /// <summary>
/// Event triggered when a <see cref="IHierarchyObject"/> is unregistered from the <see cref="IGameManager"/>. /// Event triggered when a <see cref="IHierarchyObject"/> is unregistered from the <see cref="IGameManager"/>.
/// </summary> /// </summary>
event OnHierarchyObjectUnRegisteredDelegate? OnHierarchyObjectUnRegistered; event OnHierarchyObjectUnRegisteredEventHandler? OnHierarchyObjectUnRegistered;
/// <summary> /// <summary>
/// Gets a read-only list of <see cref="IGameObject"/>s managed by the <see cref="IGameManager"/>. /// Gets a read-only list of <see cref="IGameObject"/>s managed by the <see cref="IGameManager"/>.
@ -78,11 +78,11 @@ public interface IGameManager : IEntity
/// </summary> /// </summary>
void PreDraw(); void PreDraw();
delegate void OnUpdateDelegate(IGameManager sender, EngineTime time); delegate void OnUpdateEventHandler(IGameManager sender, EngineTime time);
delegate void OnPreDawDelegate(IGameManager sender); delegate void OnPreDawEventHandler(IGameManager sender);
delegate void OnGameObjectRegisteredDelegate(IGameManager sender, IGameObject gameObjectRegistered); delegate void OnGameObjectRegisteredEventHandler(IGameManager sender, IGameObject gameObjectRegistered);
delegate void OnGameObjectUnRegisteredDelegate(IGameManager sender, IGameObject gameObjectUnregistered); delegate void OnGameObjectUnRegisteredEventHandler(IGameManager sender, IGameObject gameObjectUnregistered);
delegate void OnHierarchyObjectRegisteredDelegate(IGameManager sender, IHierarchyObject hierarchyObjectRegistered); delegate void OnHierarchyObjectRegisteredEventHandler(IGameManager sender, IHierarchyObject hierarchyObjectRegistered);
delegate void OnHierarchyObjectUnRegisteredDelegate(IGameManager sender, IHierarchyObject hierarchyObjectUnregistered); delegate void OnHierarchyObjectUnRegisteredEventHandler(IGameManager sender, IHierarchyObject hierarchyObjectUnregistered);
} }

View File

@ -8,12 +8,12 @@ public interface IGameObject : IEntity, IHierarchyObject, IAssignableTransform,
/// <summary> /// <summary>
/// Event triggered when the <see cref="Update"/> method is called. /// Event triggered when the <see cref="Update"/> method is called.
/// </summary> /// </summary>
event OnUpdatedDelegate? OnUpdated; event OnUpdatedEventHandler? OnUpdated;
/// <summary> /// <summary>
/// Updates the game object. /// Updates the game object.
/// </summary> /// </summary>
void Update(); void Update();
delegate void OnUpdatedDelegate(IGameObject sender); delegate void OnUpdatedEventHandler(IGameObject sender);
} }

View File

@ -8,12 +8,12 @@ public interface IInitialize
/// <summary> /// <summary>
/// Event triggered when the <see cref="Initialize"/> method is called successfully. /// Event triggered when the <see cref="Initialize"/> method is called successfully.
/// </summary> /// </summary>
event OnInitializedDelegate? OnInitialized; event OnInitializedEventHandler? OnInitialized;
/// <summary> /// <summary>
/// Event triggered when the <see cref="Finalize"/> method is called successfully. /// Event triggered when the <see cref="Finalize"/> method is called successfully.
/// </summary> /// </summary>
event OnFinalizedDelegate? OnFinalized; event OnFinalizedEventHandler? OnFinalized;
/// <summary> /// <summary>
/// The value indicating whether the entity has been initialized. /// The value indicating whether the entity has been initialized.
@ -32,6 +32,6 @@ public interface IInitialize
/// <returns><see cref="true"/> if finalization is successful, otherwise <see cref="false"/>.</returns> /// <returns><see cref="true"/> if finalization is successful, otherwise <see cref="false"/>.</returns>
bool Finalize(); bool Finalize();
delegate void OnInitializedDelegate(IInitialize sender); delegate void OnInitializedEventHandler(IInitialize sender);
delegate void OnFinalizedDelegate(IInitialize sender); delegate void OnFinalizedEventHandler(IInitialize sender);
} }

View File

@ -8,12 +8,12 @@ public interface INameable
/// <summary> /// <summary>
/// Event triggered when the name of the entity changes. /// Event triggered when the name of the entity changes.
/// </summary> /// </summary>
event OnNameChangedDelegate? OnNameChanged; event OnNameChangedEventHandler? OnNameChanged;
/// <summary> /// <summary>
/// The name of the entity. /// The name of the entity.
/// </summary> /// </summary>
string Name { get; set; } string Name { get; set; }
delegate void OnNameChangedDelegate(INameable sender, string previousName); delegate void OnNameChangedEventHandler(INameable sender, string previousName);
} }

View File

@ -8,12 +8,12 @@ public interface IStateEnable : IAssignableEntity
/// <summary> /// <summary>
/// Event triggered when the <see cref="Enabled"/> state of the <see cref="IStateEnable"/> changes. /// Event triggered when the <see cref="Enabled"/> state of the <see cref="IStateEnable"/> changes.
/// </summary> /// </summary>
event OnNameChangedDelegate? OnEnabledChanged; event OnNameChangedEventHandler? OnEnabledChanged;
/// <summary> /// <summary>
/// The value indicating whether the <see cref="IStateEnable"/> is enabled. /// The value indicating whether the <see cref="IStateEnable"/> is enabled.
/// </summary> /// </summary>
bool Enabled { get; set; } bool Enabled { get; set; }
delegate void OnNameChangedDelegate(IStateEnable sender, bool previousState); delegate void OnNameChangedEventHandler(IStateEnable sender, bool previousState);
} }

View File

@ -11,32 +11,32 @@ public interface ITransform : IAssignableGameObject, IEnumerable<ITransform>
/// <summary> /// <summary>
/// Event triggered when the <see cref="Position"/> of the <see cref="ITransform"/> changes. /// Event triggered when the <see cref="Position"/> of the <see cref="ITransform"/> changes.
/// </summary> /// </summary>
event OnPositionChangedDelegate? OnPositionChanged; event OnPositionChangedEventHandler? OnPositionChanged;
/// <summary> /// <summary>
/// Event triggered when the <see cref="Scale"/> of the <see cref="ITransform"/> changes. /// Event triggered when the <see cref="Scale"/> of the <see cref="ITransform"/> changes.
/// </summary> /// </summary>
event OnScaleChangedDelegate? OnScaleChanged; event OnScaleChangedEventHandler? OnScaleChanged;
/// <summary> /// <summary>
/// Event triggered when the <see cref="Rotation"/> of the <see cref="ITransform"/> changes. /// Event triggered when the <see cref="Rotation"/> of the <see cref="ITransform"/> changes.
/// </summary> /// </summary>
event OnRotationChangedDelegate? OnRotationChanged; event OnRotationChangedEventHandler? OnRotationChanged;
/// <summary> /// <summary>
/// Event triggered when the <see cref="Parent"/> of the <see cref="ITransform"/> changes. The second parameter is the old <see cref="ITransform"/>. /// Event triggered when the <see cref="Parent"/> of the <see cref="ITransform"/> changes. The second parameter is the old <see cref="ITransform"/>.
/// </summary> /// </summary>
event OnParentChangedDelegate? OnParentChanged; event OnParentChangedEventHandler? OnParentChanged;
/// <summary> /// <summary>
/// Event triggered when a new <see cref="ITransform"/> is added to the <see cref="Children"/>. /// Event triggered when a new <see cref="ITransform"/> is added to the <see cref="Children"/>.
/// </summary> /// </summary>
event OnChildrenAddedDelegate? OnChildrenAdded; event OnChildrenAddedEventHandler? OnChildrenAdded;
/// <summary> /// <summary>
/// Event triggered when an <see cref="ITransform"/> is removed from the <see cref="Children"/>. /// Event triggered when an <see cref="ITransform"/> is removed from the <see cref="Children"/>.
/// </summary> /// </summary>
event OnChildrenRemovedDelegate? OnChildrenRemoved; event OnChildrenRemovedEventHandler? OnChildrenRemoved;
/// <summary> /// <summary>
/// The world position of the <see cref="ITransform"/> in 2D space. /// The world position of the <see cref="ITransform"/> in 2D space.
@ -96,10 +96,10 @@ public interface ITransform : IAssignableGameObject, IEnumerable<ITransform>
/// <param name="transform">The child <see cref="ITransform"/> to remove.</param> /// <param name="transform">The child <see cref="ITransform"/> to remove.</param>
void RemoveChild(ITransform transform); void RemoveChild(ITransform transform);
delegate void OnPositionChangedDelegate(ITransform sender); delegate void OnPositionChangedEventHandler(ITransform sender);
delegate void OnScaleChangedDelegate(ITransform sender); delegate void OnScaleChangedEventHandler(ITransform sender);
delegate void OnRotationChangedDelegate(ITransform sender); delegate void OnRotationChangedEventHandler(ITransform sender);
delegate void OnParentChangedDelegate(ITransform sender, ITransform? previousParent, ITransform? newParent); delegate void OnParentChangedEventHandler(ITransform sender, ITransform? previousParent, ITransform? newParent);
delegate void OnChildrenAddedDelegate(ITransform sender, ITransform childrenAdded); delegate void OnChildrenAddedEventHandler(ITransform sender, ITransform childrenAdded);
delegate void OnChildrenRemovedDelegate(ITransform sender, ITransform childrenRemoved); delegate void OnChildrenRemovedEventHandler(ITransform sender, ITransform childrenRemoved);
} }

View File

@ -6,9 +6,9 @@ namespace Syntriax.Engine.Core;
[System.Diagnostics.DebuggerDisplay("{GetType().Name, nq}, Priority: {Priority}, Initialized: {Initialized}")] [System.Diagnostics.DebuggerDisplay("{GetType().Name, nq}, Priority: {Priority}, Initialized: {Initialized}")]
public abstract class BehaviourBase : BaseEntity, IBehaviour 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!; private IBehaviourController _behaviourController = null!;

View File

@ -8,11 +8,11 @@ namespace Syntriax.Engine.Core;
public class BehaviourCollector<T> : IAssignableGameManager, IEnumerable<T> public class BehaviourCollector<T> : IAssignableGameManager, IEnumerable<T>
{ {
public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null;
public event IAssignableGameManager.OnGameManagerAssignedDelegate? OnGameManagerAssigned = null; public event IAssignableGameManager.OnGameManagerAssignedEventHandler? OnGameManagerAssigned = null;
public event OnCollectedDelegate? OnCollected = null; public event OnCollectedEventHandler? OnCollected = null;
public event OnRemovedDelegate? OnRemoved = null; public event OnRemovedEventHandler? OnRemoved = null;
private readonly List<T> _behaviours = new(32); private readonly List<T> _behaviours = new(32);
@ -99,6 +99,6 @@ public class BehaviourCollector<T> : IAssignableGameManager, IEnumerable<T>
IEnumerator IEnumerable.GetEnumerator() => _behaviours.GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => _behaviours.GetEnumerator();
public delegate void OnCollectedDelegate(BehaviourCollector<T> sender, T behaviourCollected); public delegate void OnCollectedEventHandler(BehaviourCollector<T> sender, T behaviourCollected);
public delegate void OnRemovedDelegate(BehaviourCollector<T> sender, T behaviourRemoved); public delegate void OnRemovedEventHandler(BehaviourCollector<T> sender, T behaviourRemoved);
} }

View File

@ -12,18 +12,18 @@ namespace Syntriax.Engine.Core;
[System.Diagnostics.DebuggerDisplay("Behaviour Count: {behaviours.Count}")] [System.Diagnostics.DebuggerDisplay("Behaviour Count: {behaviours.Count}")]
public class BehaviourController : IBehaviourController public class BehaviourController : IBehaviourController
{ {
public event IBehaviourController.OnPreUpdateDelegate? OnPreUpdate = null; public event IBehaviourController.OnPreUpdateEventHandler? OnPreUpdate = null;
public event IBehaviourController.OnUpdateDelegate? OnUpdate = null; public event IBehaviourController.OnUpdateEventHandler? OnUpdate = null;
public event IBehaviourController.OnPreDrawDelegate? OnPreDraw = null; public event IBehaviourController.OnPreDrawEventHandler? OnPreDraw = null;
public event IBehaviourController.OnBehaviourAddedDelegate? OnBehaviourAdded = null; public event IBehaviourController.OnBehaviourAddedEventHandler? OnBehaviourAdded = null;
public event IBehaviourController.OnBehaviourRemovedDelegate? OnBehaviourRemoved = null; public event IBehaviourController.OnBehaviourRemovedEventHandler? OnBehaviourRemoved = null;
public event IAssignableGameObject.OnGameObjectAssignedDelegate? OnGameObjectAssigned = null; public event IAssignableGameObject.OnGameObjectAssignedEventHandler? OnGameObjectAssigned = null;
public event IInitialize.OnInitializedDelegate? OnInitialized = null; public event IInitialize.OnInitializedEventHandler? OnInitialized = null;
public event IInitialize.OnFinalizedDelegate? OnFinalized = null; public event IInitialize.OnFinalizedEventHandler? OnFinalized = null;
public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null;
private readonly IList<IBehaviour> behaviours = new List<IBehaviour>(Constants.BEHAVIOURS_SIZE_INITIAL); private readonly IList<IBehaviour> behaviours = new List<IBehaviour>(Constants.BEHAVIOURS_SIZE_INITIAL);

View File

@ -11,13 +11,13 @@ namespace Syntriax.Engine.Core;
[System.Diagnostics.DebuggerDisplay("GameObject Count: {_gameObjects.Count}")] [System.Diagnostics.DebuggerDisplay("GameObject Count: {_gameObjects.Count}")]
public class GameManager : BaseEntity, IGameManager public class GameManager : BaseEntity, IGameManager
{ {
public event IGameManager.OnUpdateDelegate? OnUpdate = null; public event IGameManager.OnUpdateEventHandler? OnUpdate = null;
public event IGameManager.OnPreDawDelegate? OnPreDraw = null; public event IGameManager.OnPreDawEventHandler? OnPreDraw = null;
public event IGameManager.OnGameObjectRegisteredDelegate? OnGameObjectRegistered = null; public event IGameManager.OnGameObjectRegisteredEventHandler? OnGameObjectRegistered = null;
public event IGameManager.OnGameObjectUnRegisteredDelegate? OnGameObjectUnRegistered = null; public event IGameManager.OnGameObjectUnRegisteredEventHandler? OnGameObjectUnRegistered = null;
public event IGameManager.OnHierarchyObjectRegisteredDelegate? OnHierarchyObjectRegistered = null; public event IGameManager.OnHierarchyObjectRegisteredEventHandler? OnHierarchyObjectRegistered = null;
public event IGameManager.OnHierarchyObjectUnRegisteredDelegate? OnHierarchyObjectUnRegistered = null; public event IGameManager.OnHierarchyObjectUnRegisteredEventHandler? OnHierarchyObjectUnRegistered = null;
private readonly List<IGameObject> _gameObjects = new(Constants.GAME_OBJECTS_SIZE_INITIAL); private readonly List<IGameObject> _gameObjects = new(Constants.GAME_OBJECTS_SIZE_INITIAL);
private readonly List<IHierarchyObject> _hierarchyObjects = new(Constants.GAME_OBJECTS_SIZE_INITIAL); private readonly List<IHierarchyObject> _hierarchyObjects = new(Constants.GAME_OBJECTS_SIZE_INITIAL);

View File

@ -6,15 +6,15 @@ namespace Syntriax.Engine.Core;
[System.Diagnostics.DebuggerDisplay("Name: {Name}, Initialized: {Initialized}")] [System.Diagnostics.DebuggerDisplay("Name: {Name}, Initialized: {Initialized}")]
public class GameObject : BaseEntity, IGameObject public class GameObject : BaseEntity, IGameObject
{ {
public event IHierarchyObject.OnEnteredHierarchyDelegate? OnEnteredHierarchy = null; public event IHierarchyObject.OnEnteredHierarchyEventHandler? OnEnteredHierarchy = null;
public event IHierarchyObject.OnExitedHierarchyDelegate? OnExitedHierarchy = null; public event IHierarchyObject.OnExitedHierarchyEventHandler? OnExitedHierarchy = null;
public event IAssignableTransform.OnTransformAssignedDelegate? OnTransformAssigned = null; public event IAssignableTransform.OnTransformAssignedEventHandler? OnTransformAssigned = null;
public event IAssignableBehaviourController.OnBehaviourControllerAssignedDelegate? OnBehaviourControllerAssigned = 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 ITransform _transform = null!;
private IBehaviourController _behaviourController = null!; private IBehaviourController _behaviourController = null!;

View File

@ -4,14 +4,14 @@ namespace Syntriax.Engine.Core;
public abstract class HierarchyObjectBase : IHierarchyObject public abstract class HierarchyObjectBase : IHierarchyObject
{ {
public event IHierarchyObject.OnEnteredHierarchyDelegate? OnEnteredHierarchy = null; public event IHierarchyObject.OnEnteredHierarchyEventHandler? OnEnteredHierarchy = null;
public event IHierarchyObject.OnExitedHierarchyDelegate? OnExitedHierarchy = null; public event IHierarchyObject.OnExitedHierarchyEventHandler? OnExitedHierarchy = null;
public event IEntity.OnIdChangedDelegate? OnIdChanged = null; public event IEntity.OnIdChangedEventHandler? OnIdChanged = null;
public event IInitialize.OnInitializedDelegate? OnInitialized = null; public event IInitialize.OnInitializedEventHandler? OnInitialized = null;
public event IInitialize.OnFinalizedDelegate? OnFinalized = null; public event IInitialize.OnFinalizedEventHandler? OnFinalized = null;
public event IAssignableStateEnable.OnStateEnableAssignedDelegate? OnStateEnableAssigned = null; public event IAssignableStateEnable.OnStateEnableAssignedEventHandler? OnStateEnableAssigned = null;
public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null;
public event INameable.OnNameChangedDelegate? OnNameChanged = null; public event INameable.OnNameChangedEventHandler? OnNameChanged = null;
private string _id = string.Empty; private string _id = string.Empty;
private string _name = nameof(HierarchyObjectBase); private string _name = nameof(HierarchyObjectBase);

View File

@ -4,9 +4,9 @@ namespace Syntriax.Engine.Core;
public class StateEnable : IStateEnable public class StateEnable : IStateEnable
{ {
public event IAssignable.OnUnassignedDelegate? OnUnassigned = null; public event IAssignable.OnUnassignedEventHandler? OnUnassigned = null;
public event IAssignableEntity.OnEntityAssignedDelegate? OnEntityAssigned = null; public event IAssignableEntity.OnEntityAssignedEventHandler? OnEntityAssigned = null;
public event IStateEnable.OnNameChangedDelegate? OnEnabledChanged = null; public event IStateEnable.OnNameChangedEventHandler? OnEnabledChanged = null;
private bool _enabled = true; private bool _enabled = true;
private IEntity _entity = null!; private IEntity _entity = null!;

View File

@ -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}")] [System.Diagnostics.DebuggerDisplay("Name: {GameObject.Name, nq} Position: {Position.ToString(), nq}, Scale: {Scale.ToString(), nq}, Rotation: {Rotation}")]
public class Transform : ITransform 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.OnPositionChangedEventHandler? OnPositionChanged = null;
public event ITransform.OnScaleChangedDelegate? OnScaleChanged = null; public event ITransform.OnScaleChangedEventHandler? OnScaleChanged = null;
public event ITransform.OnRotationChangedDelegate? OnRotationChanged = null; public event ITransform.OnRotationChangedEventHandler? OnRotationChanged = null;
public event ITransform.OnParentChangedDelegate? OnParentChanged = null; public event ITransform.OnParentChangedEventHandler? OnParentChanged = null;
public event ITransform.OnChildrenAddedDelegate? OnChildrenAdded = null; public event ITransform.OnChildrenAddedEventHandler? OnChildrenAdded = null;
public event ITransform.OnChildrenRemovedDelegate? OnChildrenRemoved = null; public event ITransform.OnChildrenRemovedEventHandler? OnChildrenRemoved = null;
private Vector2D _position = Vector2D.Zero; private Vector2D _position = Vector2D.Zero;

View File

@ -4,12 +4,12 @@ namespace Syntriax.Engine.Input;
public interface IButtonInputs<T> : IAssignableStateEnable public interface IButtonInputs<T> : IAssignableStateEnable
{ {
void RegisterOnPress(T button, ButtonCallbackDelegate callback); void RegisterOnPress(T button, ButtonCallbackEventHandler callback);
void UnregisterOnPress(T button, ButtonCallbackDelegate callback); void UnregisterOnPress(T button, ButtonCallbackEventHandler callback);
void RegisterOnRelease(T button, ButtonCallbackDelegate callback); void RegisterOnRelease(T button, ButtonCallbackEventHandler callback);
void UnregisterOnRelease(T button, ButtonCallbackDelegate callback); void UnregisterOnRelease(T button, ButtonCallbackEventHandler callback);
bool IsPressed(T button); bool IsPressed(T button);
delegate void ButtonCallbackDelegate(IButtonInputs<T> buttonInputs, T button); delegate void ButtonCallbackEventHandler(IButtonInputs<T> buttonInputs, T button);
} }

View File

@ -10,17 +10,17 @@ public interface ICollider2D : IBehaviour, IAssignableTransform
/// <summary> /// <summary>
/// Event triggered when a collision is detected. /// Event triggered when a collision is detected.
/// </summary> /// </summary>
event OnCollisionDetectedDelegate? OnCollisionDetected; event OnCollisionDetectedEventHandler? OnCollisionDetected;
/// <summary> /// <summary>
/// Event triggered when a collision is resolved. /// Event triggered when a collision is resolved.
/// </summary> /// </summary>
event OnCollisionResolvedDelegate? OnCollisionResolved; event OnCollisionResolvedEventHandler? OnCollisionResolved;
/// <summary> /// <summary>
/// Event triggered when another <see cref="ICollider2D"/> triggers this <see cref="ICollider2D"/>. /// Event triggered when another <see cref="ICollider2D"/> triggers this <see cref="ICollider2D"/>.
/// </summary> /// </summary>
event OnTriggeredDelegate? OnTriggered; event OnTriggeredEventHandler? OnTriggered;
/// <summary> /// <summary>
/// The <see cref="IRigidBody2D"/> associated with the <see cref="ICollider2D"/>. /// The <see cref="IRigidBody2D"/> associated with the <see cref="ICollider2D"/>.
@ -41,7 +41,7 @@ public interface ICollider2D : IBehaviour, IAssignableTransform
void Resolve(CollisionDetectionInformation collisionDetectionInformation); void Resolve(CollisionDetectionInformation collisionDetectionInformation);
void Trigger(ICollider2D initiator); void Trigger(ICollider2D initiator);
delegate void OnCollisionDetectedDelegate(ICollider2D sender, CollisionDetectionInformation collisionDetectionInformation); delegate void OnCollisionDetectedEventHandler(ICollider2D sender, CollisionDetectionInformation collisionDetectionInformation);
delegate void OnCollisionResolvedDelegate(ICollider2D sender, CollisionDetectionInformation collisionDetectionInformation); delegate void OnCollisionResolvedEventHandler(ICollider2D sender, CollisionDetectionInformation collisionDetectionInformation);
delegate void OnTriggeredDelegate(ICollider2D sender, ICollider2D initiatorCollider); delegate void OnTriggeredEventHandler(ICollider2D sender, ICollider2D initiatorCollider);
} }

View File

@ -8,12 +8,12 @@ public interface IPhysicsEngine2D
/// <summary> /// <summary>
/// Event triggered when the <see cref="IPhysicsEngine2D"/> has done a single physics iteration. /// Event triggered when the <see cref="IPhysicsEngine2D"/> has done a single physics iteration.
/// </summary> /// </summary>
event OnPhysicsIterationDelegate? OnPhysicsIteration; event OnPhysicsIterationEventHandler? OnPhysicsIteration;
/// <summary> /// <summary>
/// Event triggered when the <see cref="IPhysicsEngine2D"/> has done a full physics step/>. /// Event triggered when the <see cref="IPhysicsEngine2D"/> has done a full physics step/>.
/// </summary> /// </summary>
event OnPhysicsStepDelegate? OnPhysicsStep; event OnPhysicsStepEventHandler? OnPhysicsStep;
/// <summary> /// <summary>
/// The number of iterations the <see cref="IPhysicsEngine2D"/> performs per step. /// The number of iterations the <see cref="IPhysicsEngine2D"/> performs per step.
@ -26,6 +26,6 @@ public interface IPhysicsEngine2D
/// <param name="deltaTime">The time step.</param> /// <param name="deltaTime">The time step.</param>
void Step(float deltaTime); void Step(float deltaTime);
delegate void OnPhysicsIterationDelegate(IPhysicsEngine2D sender, float iterationDeltaTime); delegate void OnPhysicsIterationEventHandler(IPhysicsEngine2D sender, float iterationDeltaTime);
delegate void OnPhysicsStepDelegate(IPhysicsEngine2D sender, float stepDeltaTime); delegate void OnPhysicsStepEventHandler(IPhysicsEngine2D sender, float stepDeltaTime);
} }

View File

@ -6,9 +6,9 @@ namespace Syntriax.Engine.Physics2D;
public abstract class Collider2DBehaviourBase : Behaviour, ICollider2D public abstract class Collider2DBehaviourBase : Behaviour, ICollider2D
{ {
public event ICollider2D.OnCollisionDetectedDelegate? OnCollisionDetected = null; public event ICollider2D.OnCollisionDetectedEventHandler? OnCollisionDetected = null;
public event ICollider2D.OnCollisionResolvedDelegate? OnCollisionResolved = null; public event ICollider2D.OnCollisionResolvedEventHandler? OnCollisionResolved = null;
public event ICollider2D.OnTriggeredDelegate? OnTriggered = null; public event ICollider2D.OnTriggeredEventHandler? OnTriggered = null;
protected bool NeedsRecalculation { get; private set; } = true; protected bool NeedsRecalculation { get; private set; } = true;
@ -18,7 +18,7 @@ public abstract class Collider2DBehaviourBase : Behaviour, ICollider2D
public bool IsTrigger { get; set; } = false; public bool IsTrigger { get; set; } = false;
ITransform IAssignableTransform.Transform => Transform; 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); bool IAssignableTransform.Assign(ITransform transform) => GameObject.Assign(transform);

View File

@ -7,8 +7,8 @@ namespace Syntriax.Engine.Physics2D;
public class PhysicsEngine2D : IPhysicsEngine2D public class PhysicsEngine2D : IPhysicsEngine2D
{ {
public event IPhysicsEngine2D.OnPhysicsIterationDelegate? OnPhysicsIteration = null; public event IPhysicsEngine2D.OnPhysicsIterationEventHandler? OnPhysicsIteration = null;
public event IPhysicsEngine2D.OnPhysicsStepDelegate? OnPhysicsStep = null; public event IPhysicsEngine2D.OnPhysicsStepEventHandler? OnPhysicsStep = null;
private readonly List<IRigidBody2D> rigidBodies = new(32); private readonly List<IRigidBody2D> rigidBodies = new(32);
private readonly List<ICollider2D> colliders = new(64); private readonly List<ICollider2D> colliders = new(64);

View File

@ -6,8 +6,8 @@ namespace Syntriax.Engine.Physics2D;
public class PhysicsEngine2DCollector : HierarchyObjectBase, IPhysicsEngine2D public class PhysicsEngine2DCollector : HierarchyObjectBase, IPhysicsEngine2D
{ {
public event IPhysicsEngine2D.OnPhysicsIterationDelegate? OnPhysicsIteration = null; public event IPhysicsEngine2D.OnPhysicsIterationEventHandler? OnPhysicsIteration = null;
public event IPhysicsEngine2D.OnPhysicsStepDelegate? OnPhysicsStep = null; public event IPhysicsEngine2D.OnPhysicsStepEventHandler? OnPhysicsStep = null;
private int _iterationPerStep = 1; private int _iterationPerStep = 1;

View File

@ -6,7 +6,7 @@ namespace Syntriax.Engine.Physics2D;
public class RigidBody2D : Behaviour, IRigidBody2D 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 const float LOWEST_ALLOWED_MASS = 0.00001f;
private float _mass = 1f; private float _mass = 1f;