From c8bb991865c8efc99786a9a10767f08ce7b8709c Mon Sep 17 00:00:00 2001 From: Syntriax Date: Wed, 9 Jul 2025 22:19:44 +0300 Subject: [PATCH] refactor!: removed noise from class names Renamed classes with names XBehaviour to X --- .../{DrawableShapeBehaviour.cs => DrawableShape.cs} | 8 ++++---- .../{KeyboardInputsBehaviour.cs => KeyboardInputs.cs} | 2 +- .../{MonoGameCamera2DBehaviour.cs => MonoGameCamera2D.cs} | 8 ++++---- .../Behaviours/SpriteBatcher.cs | 4 ++-- .../Behaviours/TriangleBatcher.cs | 4 ++-- .../{Collider2DBehaviourBase.cs => Collider2DBase.cs} | 4 ++-- .../{Collider2DCircleBehaviour.cs => Collider2DCircle.cs} | 6 +++--- .../{Collider2DShapeBehaviour.cs => Collider2DShape.cs} | 6 +++--- .../Time/{StopwatchBehaviour.cs => Stopwatch.cs} | 2 +- Engine.Systems/Time/{TickerBehaviour.cs => Ticker.cs} | 2 +- Engine.Systems/Time/{TimerBehaviour.cs => Timer.cs} | 2 +- 11 files changed, 24 insertions(+), 24 deletions(-) rename Engine.Integration/Engine.Integration.MonoGame/Behaviours/{DrawableShapeBehaviour.cs => DrawableShape.cs} (68%) rename Engine.Integration/Engine.Integration.MonoGame/Behaviours/{KeyboardInputsBehaviour.cs => KeyboardInputs.cs} (98%) rename Engine.Integration/Engine.Integration.MonoGame/Behaviours/{MonoGameCamera2DBehaviour.cs => MonoGameCamera2D.cs} (93%) rename Engine.Physics2D/{Collider2DBehaviourBase.cs => Collider2DBase.cs} (97%) rename Engine.Physics2D/{Collider2DCircleBehaviour.cs => Collider2DCircle.cs} (69%) rename Engine.Physics2D/{Collider2DShapeBehaviour.cs => Collider2DShape.cs} (76%) rename Engine.Systems/Time/{StopwatchBehaviour.cs => Stopwatch.cs} (97%) rename Engine.Systems/Time/{TickerBehaviour.cs => Ticker.cs} (92%) rename Engine.Systems/Time/{TimerBehaviour.cs => Timer.cs} (97%) diff --git a/Engine.Integration/Engine.Integration.MonoGame/Behaviours/DrawableShapeBehaviour.cs b/Engine.Integration/Engine.Integration.MonoGame/Behaviours/DrawableShape.cs similarity index 68% rename from Engine.Integration/Engine.Integration.MonoGame/Behaviours/DrawableShapeBehaviour.cs rename to Engine.Integration/Engine.Integration.MonoGame/Behaviours/DrawableShape.cs index dbfef7e..ba31f23 100644 --- a/Engine.Integration/Engine.Integration.MonoGame/Behaviours/DrawableShapeBehaviour.cs +++ b/Engine.Integration/Engine.Integration.MonoGame/Behaviours/DrawableShape.cs @@ -4,7 +4,7 @@ using Syntriax.Engine.Core; namespace Syntriax.Engine.Integration.MonoGame; -public class DrawableShapeBehaviour : Behaviour2D, IDrawableTriangle, IPreDraw +public class DrawableShape : Behaviour2D, IDrawableTriangle, IPreDraw { private readonly Shape2D shape = new([]); private readonly List worldTriangles = []; @@ -23,7 +23,7 @@ public class DrawableShapeBehaviour : Behaviour2D, IDrawableTriangle, IPreDraw protected void UpdateWorldShape() => shape.Transform(Transform, worldShape); - public DrawableShapeBehaviour() => shape = Shape2D.Triangle; - public DrawableShapeBehaviour(Shape2D shape) => this.shape = shape; - public DrawableShapeBehaviour(Shape2D shape, ColorRGB color) { this.shape = shape; this.color = color; } + public DrawableShape() => shape = Shape2D.Triangle; + public DrawableShape(Shape2D shape) => this.shape = shape; + public DrawableShape(Shape2D shape, ColorRGB color) { this.shape = shape; this.color = color; } } diff --git a/Engine.Integration/Engine.Integration.MonoGame/Behaviours/KeyboardInputsBehaviour.cs b/Engine.Integration/Engine.Integration.MonoGame/Behaviours/KeyboardInputs.cs similarity index 98% rename from Engine.Integration/Engine.Integration.MonoGame/Behaviours/KeyboardInputsBehaviour.cs rename to Engine.Integration/Engine.Integration.MonoGame/Behaviours/KeyboardInputs.cs index 944fcc1..350e92f 100644 --- a/Engine.Integration/Engine.Integration.MonoGame/Behaviours/KeyboardInputsBehaviour.cs +++ b/Engine.Integration/Engine.Integration.MonoGame/Behaviours/KeyboardInputs.cs @@ -8,7 +8,7 @@ using Syntriax.Engine.Systems.Input; namespace Syntriax.Engine.Integration.MonoGame; -public class KeyboardInputsBehaviour : Behaviour, IButtonInputs, IUpdate +public class KeyboardInputs : Behaviour, IButtonInputs, IUpdate { public Event, IButtonInputs.ButtonCallbackArguments> OnAnyButtonPressed { get; } = new(); public Event, IButtonInputs.ButtonCallbackArguments> OnAnyButtonReleased { get; } = new(); diff --git a/Engine.Integration/Engine.Integration.MonoGame/Behaviours/MonoGameCamera2DBehaviour.cs b/Engine.Integration/Engine.Integration.MonoGame/Behaviours/MonoGameCamera2D.cs similarity index 93% rename from Engine.Integration/Engine.Integration.MonoGame/Behaviours/MonoGameCamera2DBehaviour.cs rename to Engine.Integration/Engine.Integration.MonoGame/Behaviours/MonoGameCamera2D.cs index 553c843..7357ae7 100644 --- a/Engine.Integration/Engine.Integration.MonoGame/Behaviours/MonoGameCamera2DBehaviour.cs +++ b/Engine.Integration/Engine.Integration.MonoGame/Behaviours/MonoGameCamera2D.cs @@ -5,7 +5,7 @@ using Syntriax.Engine.Core; namespace Syntriax.Engine.Integration.MonoGame; -public class MonoGameCamera2DBehaviour : BehaviourBase, ICamera2D, IFirstFrameUpdate, IPreDraw +public class MonoGameCamera2D : BehaviourBase, ICamera2D, IFirstFrameUpdate, IPreDraw { public event MatrixTransformChangedArguments? OnMatrixTransformChanged = null; public event ViewportChangedArguments? OnViewportChanged = null; @@ -103,7 +103,7 @@ public class MonoGameCamera2DBehaviour : BehaviourBase, ICamera2D, IFirstFrameUp protected sealed override void InitializeInternal() => Transform = BehaviourController.GetRequiredBehaviour(); protected sealed override void FinalizeInternal() => Transform = null!; - public delegate void MatrixTransformChangedArguments(MonoGameCamera2DBehaviour sender); - public delegate void ViewportChangedArguments(MonoGameCamera2DBehaviour sender); - public delegate void ZoomChangedArguments(MonoGameCamera2DBehaviour sender); + public delegate void MatrixTransformChangedArguments(MonoGameCamera2D sender); + public delegate void ViewportChangedArguments(MonoGameCamera2D sender); + public delegate void ZoomChangedArguments(MonoGameCamera2D sender); } diff --git a/Engine.Integration/Engine.Integration.MonoGame/Behaviours/SpriteBatcher.cs b/Engine.Integration/Engine.Integration.MonoGame/Behaviours/SpriteBatcher.cs index 88b13ac..f3f57ae 100644 --- a/Engine.Integration/Engine.Integration.MonoGame/Behaviours/SpriteBatcher.cs +++ b/Engine.Integration/Engine.Integration.MonoGame/Behaviours/SpriteBatcher.cs @@ -9,14 +9,14 @@ public class SpriteBatcher : BehaviourBase, IFirstFrameUpdate, IDraw private static Comparer SortByPriority() => Comparer.Create((x, y) => y.Priority.CompareTo(x.Priority)); private ISpriteBatch spriteBatch = null!; - private MonoGameCamera2DBehaviour camera2D = null!; + private MonoGameCamera2D camera2D = null!; private readonly ActiveBehaviourCollectorSorted drawableSprites = new() { SortBy = SortByPriority() }; public void FirstActiveFrame() { MonoGameWindowContainer windowContainer = Universe.FindRequiredBehaviour(); - camera2D = Universe.FindRequiredBehaviour(); + camera2D = Universe.FindRequiredBehaviour(); spriteBatch = new SpriteBatchWrapper(windowContainer.Window.GraphicsDevice); drawableSprites.Unassign(); diff --git a/Engine.Integration/Engine.Integration.MonoGame/Behaviours/TriangleBatcher.cs b/Engine.Integration/Engine.Integration.MonoGame/Behaviours/TriangleBatcher.cs index 4215384..11bca97 100644 --- a/Engine.Integration/Engine.Integration.MonoGame/Behaviours/TriangleBatcher.cs +++ b/Engine.Integration/Engine.Integration.MonoGame/Behaviours/TriangleBatcher.cs @@ -11,13 +11,13 @@ public class TriangleBatcher : BehaviourBase, ITriangleBatch, IFirstFrameUpdate, private static Comparer SortByAscendingPriority() => Comparer.Create((x, y) => x.Priority.CompareTo(y.Priority)); private TriangleBatch triangleBatch = null!; - private MonoGameCamera2DBehaviour camera2D = null!; + private MonoGameCamera2D camera2D = null!; private readonly ActiveBehaviourCollectorSorted drawableShapes = new() { SortBy = SortByAscendingPriority() }; public void FirstActiveFrame() { MonoGameWindowContainer windowContainer = BehaviourController.UniverseObject.Universe.FindRequiredBehaviour(); - camera2D = BehaviourController.UniverseObject.Universe.FindRequiredBehaviour(); + camera2D = BehaviourController.UniverseObject.Universe.FindRequiredBehaviour(); triangleBatch = new(windowContainer.Window.GraphicsDevice); drawableShapes.Unassign(); diff --git a/Engine.Physics2D/Collider2DBehaviourBase.cs b/Engine.Physics2D/Collider2DBase.cs similarity index 97% rename from Engine.Physics2D/Collider2DBehaviourBase.cs rename to Engine.Physics2D/Collider2DBase.cs index 209d860..bca0735 100644 --- a/Engine.Physics2D/Collider2DBehaviourBase.cs +++ b/Engine.Physics2D/Collider2DBase.cs @@ -2,7 +2,7 @@ using Syntriax.Engine.Core; namespace Syntriax.Engine.Physics2D; -public abstract class Collider2DBehaviourBase : Behaviour2D, ICollider2D +public abstract class Collider2DBase : Behaviour2D, ICollider2D { public Event OnCollisionDetected { get; } = new(); public Event OnCollisionResolved { get; } = new(); @@ -18,7 +18,7 @@ public abstract class Collider2DBehaviourBase : Behaviour2D, ICollider2D protected bool NeedsRecalculation { get; set; } = true; protected IRigidBody2D? _rigidBody2D = null; - protected Collider2DBehaviourBase() + protected Collider2DBase() { delegateOnBehaviourAddedToController = OnBehaviourAddedToController; delegateOnBehaviourRemovedFromController = OnBehaviourRemovedFromController; diff --git a/Engine.Physics2D/Collider2DCircleBehaviour.cs b/Engine.Physics2D/Collider2DCircle.cs similarity index 69% rename from Engine.Physics2D/Collider2DCircleBehaviour.cs rename to Engine.Physics2D/Collider2DCircle.cs index 7fb9fb0..5d2f8cb 100644 --- a/Engine.Physics2D/Collider2DCircleBehaviour.cs +++ b/Engine.Physics2D/Collider2DCircle.cs @@ -2,7 +2,7 @@ using Syntriax.Engine.Core; namespace Syntriax.Engine.Physics2D; -public class Collider2DCircleBehaviour : Collider2DBehaviourBase, ICircleCollider2D +public class Collider2DCircle : Collider2DBase, ICircleCollider2D { private Circle _circleLocal = Circle.UnitCircle; @@ -19,6 +19,6 @@ public class Collider2DCircleBehaviour : Collider2DBehaviourBase, ICircleCollide public override void CalculateCollider() => CircleWorld = Transform.Transform(_circleLocal); - public Collider2DCircleBehaviour() { } - public Collider2DCircleBehaviour(Circle circle) => CircleLocal = circle; + public Collider2DCircle() { } + public Collider2DCircle(Circle circle) => CircleLocal = circle; } diff --git a/Engine.Physics2D/Collider2DShapeBehaviour.cs b/Engine.Physics2D/Collider2DShape.cs similarity index 76% rename from Engine.Physics2D/Collider2DShapeBehaviour.cs rename to Engine.Physics2D/Collider2DShape.cs index 34d17ea..7f2b51a 100644 --- a/Engine.Physics2D/Collider2DShapeBehaviour.cs +++ b/Engine.Physics2D/Collider2DShape.cs @@ -2,7 +2,7 @@ using Syntriax.Engine.Core; namespace Syntriax.Engine.Physics2D; -public class Collider2DShapeBehaviour : Collider2DBehaviourBase, IShapeCollider2D +public class Collider2DShape : Collider2DBase, IShapeCollider2D { public Shape2D ShapeWorld { get => _shapeWorld; protected set => _shapeWorld = value; } public Shape2D ShapeLocal @@ -20,8 +20,8 @@ public class Collider2DShapeBehaviour : Collider2DBehaviourBase, IShapeCollider2 public override void CalculateCollider() => ShapeLocal.Transform(Transform, _shapeWorld); - public Collider2DShapeBehaviour() { } - public Collider2DShapeBehaviour(Shape2D shape) + public Collider2DShape() { } + public Collider2DShape(Shape2D shape) { ShapeLocal = shape; } diff --git a/Engine.Systems/Time/StopwatchBehaviour.cs b/Engine.Systems/Time/Stopwatch.cs similarity index 97% rename from Engine.Systems/Time/StopwatchBehaviour.cs rename to Engine.Systems/Time/Stopwatch.cs index 2eab89d..40593f6 100644 --- a/Engine.Systems/Time/StopwatchBehaviour.cs +++ b/Engine.Systems/Time/Stopwatch.cs @@ -2,7 +2,7 @@ using Syntriax.Engine.Core; namespace Syntriax.Engine.Systems.Time; -public class StopwatchBehaviour : Behaviour, IUpdate, IStopwatch +public class Stopwatch : Behaviour, IUpdate, IStopwatch { public Event OnStarted { get; } = new(); public Event OnDelta { get; } = new(); diff --git a/Engine.Systems/Time/TickerBehaviour.cs b/Engine.Systems/Time/Ticker.cs similarity index 92% rename from Engine.Systems/Time/TickerBehaviour.cs rename to Engine.Systems/Time/Ticker.cs index d7ada18..ec09f88 100644 --- a/Engine.Systems/Time/TickerBehaviour.cs +++ b/Engine.Systems/Time/Ticker.cs @@ -2,7 +2,7 @@ using Syntriax.Engine.Core; namespace Syntriax.Engine.Systems.Time; -public class TickerBehaviour : StopwatchBehaviour, ITicker +public class Ticker : Stopwatch, ITicker { public Event OnTick { get; } = new(); diff --git a/Engine.Systems/Time/TimerBehaviour.cs b/Engine.Systems/Time/Timer.cs similarity index 97% rename from Engine.Systems/Time/TimerBehaviour.cs rename to Engine.Systems/Time/Timer.cs index 314afac..45c01fb 100644 --- a/Engine.Systems/Time/TimerBehaviour.cs +++ b/Engine.Systems/Time/Timer.cs @@ -2,7 +2,7 @@ using Syntriax.Engine.Core; namespace Syntriax.Engine.Systems.Time; -public class TimerBehaviour : Behaviour, IUpdate, ITimer +public class Timer : Behaviour, IUpdate, ITimer { public Event OnStarted { get; } = new(); public Event OnDelta { get; } = new();