refactor!: removed noise from class names
Renamed classes with names XBehaviour to X
This commit is contained in:
@@ -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<Triangle> 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; }
|
||||
}
|
@@ -8,7 +8,7 @@ using Syntriax.Engine.Systems.Input;
|
||||
|
||||
namespace Syntriax.Engine.Integration.MonoGame;
|
||||
|
||||
public class KeyboardInputsBehaviour : Behaviour, IButtonInputs<Keys>, IUpdate
|
||||
public class KeyboardInputs : Behaviour, IButtonInputs<Keys>, IUpdate
|
||||
{
|
||||
public Event<IButtonInputs<Keys>, IButtonInputs<Keys>.ButtonCallbackArguments> OnAnyButtonPressed { get; } = new();
|
||||
public Event<IButtonInputs<Keys>, IButtonInputs<Keys>.ButtonCallbackArguments> OnAnyButtonReleased { get; } = new();
|
@@ -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<ITransform2D>();
|
||||
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);
|
||||
}
|
@@ -9,14 +9,14 @@ public class SpriteBatcher : BehaviourBase, IFirstFrameUpdate, IDraw
|
||||
private static Comparer<IBehaviour> SortByPriority() => Comparer<IBehaviour>.Create((x, y) => y.Priority.CompareTo(x.Priority));
|
||||
|
||||
private ISpriteBatch spriteBatch = null!;
|
||||
private MonoGameCamera2DBehaviour camera2D = null!;
|
||||
private MonoGameCamera2D camera2D = null!;
|
||||
|
||||
private readonly ActiveBehaviourCollectorSorted<IDrawableSprite> drawableSprites = new() { SortBy = SortByPriority() };
|
||||
|
||||
public void FirstActiveFrame()
|
||||
{
|
||||
MonoGameWindowContainer windowContainer = Universe.FindRequiredBehaviour<MonoGameWindowContainer>();
|
||||
camera2D = Universe.FindRequiredBehaviour<MonoGameCamera2DBehaviour>();
|
||||
camera2D = Universe.FindRequiredBehaviour<MonoGameCamera2D>();
|
||||
|
||||
spriteBatch = new SpriteBatchWrapper(windowContainer.Window.GraphicsDevice);
|
||||
drawableSprites.Unassign();
|
||||
|
@@ -11,13 +11,13 @@ public class TriangleBatcher : BehaviourBase, ITriangleBatch, IFirstFrameUpdate,
|
||||
private static Comparer<IBehaviour> SortByAscendingPriority() => Comparer<IBehaviour>.Create((x, y) => x.Priority.CompareTo(y.Priority));
|
||||
|
||||
private TriangleBatch triangleBatch = null!;
|
||||
private MonoGameCamera2DBehaviour camera2D = null!;
|
||||
private MonoGameCamera2D camera2D = null!;
|
||||
private readonly ActiveBehaviourCollectorSorted<IDrawableTriangle> drawableShapes = new() { SortBy = SortByAscendingPriority() };
|
||||
|
||||
public void FirstActiveFrame()
|
||||
{
|
||||
MonoGameWindowContainer windowContainer = BehaviourController.UniverseObject.Universe.FindRequiredBehaviour<MonoGameWindowContainer>();
|
||||
camera2D = BehaviourController.UniverseObject.Universe.FindRequiredBehaviour<MonoGameCamera2DBehaviour>();
|
||||
camera2D = BehaviourController.UniverseObject.Universe.FindRequiredBehaviour<MonoGameCamera2D>();
|
||||
|
||||
triangleBatch = new(windowContainer.Window.GraphicsDevice);
|
||||
drawableShapes.Unassign();
|
||||
|
Reference in New Issue
Block a user