chore: get init to only get for events

This commit is contained in:
2025-05-30 20:13:32 +03:00
parent 0d61735ae5
commit 1b123a3cc0
21 changed files with 82 additions and 82 deletions

View File

@@ -4,9 +4,9 @@ namespace Syntriax.Engine.Physics2D;
public abstract class Collider2DBehaviourBase : Behaviour2D, ICollider2D
{
public Event<ICollider2D, CollisionDetectionInformation> OnCollisionDetected { get; init; } = new();
public Event<ICollider2D, CollisionDetectionInformation> OnCollisionResolved { get; init; } = new();
public Event<ICollider2D, ICollider2D> OnTriggered { get; init; } = new();
public Event<ICollider2D, CollisionDetectionInformation> OnCollisionDetected { get; } = new();
public Event<ICollider2D, CollisionDetectionInformation> OnCollisionResolved { get; } = new();
public Event<ICollider2D, ICollider2D> OnTriggered { get; } = new();
private readonly Event<IBehaviourController, IBehaviourController.BehaviourAddedArguments>.EventHandler cachedOnBehaviourAddedToController = null!;
private readonly Event<IBehaviourController, IBehaviourController.BehaviourRemovedArguments>.EventHandler cachedOnBehaviourRemovedFromController = null!;

View File

@@ -4,8 +4,8 @@ namespace Syntriax.Engine.Physics2D;
public class PhysicsEngine2D : UniverseObject, IPhysicsEngine2D
{
public Event<IPhysicsEngine2D, float> OnPhysicsIteration { get; init; } = new();
public Event<IPhysicsEngine2D, float> OnPhysicsStep { get; init; } = new();
public Event<IPhysicsEngine2D, float> OnPhysicsIteration { get; } = new();
public Event<IPhysicsEngine2D, float> OnPhysicsStep { get; } = new();
private readonly Event<IUniverse, IUniverse.UpdateArguments>.EventHandler cachedOnPreUpdate = null!;

View File

@@ -6,8 +6,8 @@ namespace Syntriax.Engine.Physics2D;
public class PhysicsEngine2DStandalone : IPhysicsEngine2D
{
public Event<IPhysicsEngine2D, float> OnPhysicsIteration { get; init; } = new();
public Event<IPhysicsEngine2D, float> OnPhysicsStep { get; init; } = new();
public Event<IPhysicsEngine2D, float> OnPhysicsIteration { get; } = new();
public Event<IPhysicsEngine2D, float> OnPhysicsStep { get; } = new();
private readonly Event<IBehaviourController, IBehaviourController.BehaviourAddedArguments>.EventHandler cachedOnBehaviourAdded = null!;
private readonly Event<IBehaviourController, IBehaviourController.BehaviourRemovedArguments>.EventHandler cachedOnBehaviourRemoved = null!;