refactor: DebuggerDisplays For Basic Types

This commit is contained in:
Syntriax 2024-01-27 00:51:34 +03:00
parent b14d10db0c
commit 7b47703ba0
13 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,7 @@ using Syntriax.Engine.Core.Exceptions;
namespace Syntriax.Engine.Core;
[System.Diagnostics.DebuggerDisplay("Priority: {Priority}, Initialized: {Initialized}")]
public abstract class Behaviour : IBehaviour
{
public Action<IAssignable>? OnUnassigned { get; set; } = null;

View File

@ -7,6 +7,7 @@ using Syntriax.Engine.Core.Abstract;
namespace Syntriax.Engine.Core;
[System.Diagnostics.DebuggerDisplay("Behaviour Count: {behaviours.Count()}")]
public class BehaviourController : IBehaviourController
{
public Action<IBehaviourController>? OnPreUpdate { get; set; }

View File

@ -8,6 +8,7 @@ using Syntriax.Engine.Core.Factory;
namespace Syntriax.Engine.Core;
[System.Diagnostics.DebuggerDisplay("GameObject Count: {_gameObjects.Count()}")]
public class GameManager : IEntity, IEnumerable<IGameObject>
{
public Action<GameManager>? OnCameraChanged { get; set; } = null;

View File

@ -5,6 +5,7 @@ using Syntriax.Engine.Core.Exceptions;
namespace Syntriax.Engine.Core;
[System.Diagnostics.DebuggerDisplay("Name: {Name}, Initialized: {Initialized}")]
public class GameObject : IGameObject
{
public Action<IAssignableStateEnable>? OnStateEnableAssigned { get; set; } = null;

View File

@ -4,6 +4,7 @@ using Syntriax.Engine.Core.Abstract;
namespace Syntriax.Engine.Core;
[System.Diagnostics.DebuggerDisplay("Position: {Position.ToString(), nq}, Scale: {Scale.ToString(), nq}, Rotation: {Rotation}")]
public class Transform : ITransform
{
public Action<ITransform>? OnPositionChanged { get; set; } = null;

View File

@ -3,6 +3,7 @@ using Syntriax.Engine.Physics2D.Abstract;
namespace Syntriax.Engine.Physics2D;
[System.Diagnostics.DebuggerDisplay("Normal: {Normal.ToString(), nq}, Penetration: {Penetration}")]
public readonly struct CollisionDetectionInformation
(
ICollider2D Left,

View File

@ -4,6 +4,7 @@ using Syntriax.Engine.Core;
namespace Syntriax.Engine.Physics2D.Primitives;
[System.Diagnostics.DebuggerDisplay("LowerBoundary: {LowerBoundary.ToString(), nq}, UpperBoundary: {UpperBoundary.ToString(), nq}")]
public readonly struct AABB(Vector2D LowerBoundary, Vector2D UpperBoundary)
{
public readonly Vector2D LowerBoundary { get; init; } = LowerBoundary;

View File

@ -3,6 +3,7 @@ using Syntriax.Engine.Core.Abstract;
namespace Syntriax.Engine.Physics2D.Primitives;
[System.Diagnostics.DebuggerDisplay("Center: {Center.ToString(), nq}, Radius: {Radius}")]
public readonly struct Circle(Vector2D Center, float Radius)
{
public readonly Vector2D Center { get; init; } = Center;

View File

@ -6,6 +6,7 @@ using Syntriax.Engine.Core;
namespace Syntriax.Engine.Physics2D.Primitives;
[System.Diagnostics.DebuggerDisplay("From: {From.ToString(), nq}, To: {To.ToString(), nq}, Direction: {Direction.ToString(), nq}, Length: {Length}")]
public readonly struct Line(Vector2D From, Vector2D To)
{
public readonly Vector2D From { get; init; } = From;

View File

@ -2,6 +2,7 @@ using Syntriax.Engine.Core;
namespace Syntriax.Engine.Physics2D.Primitives;
[System.Diagnostics.DebuggerDisplay("y = {Slope}x + {OffsetY}")]
public readonly struct LineEquation(float Slope, float OffsetY)
{
public readonly float Slope { get; init; } = Slope;

View File

@ -1,5 +1,6 @@
namespace Syntriax.Engine.Physics2D.Primitives;
[System.Diagnostics.DebuggerDisplay("Min: {Min}, Max: {Max}")]
public readonly struct Projection(float Min, float Max)
{
public readonly float Min { get; init; } = Min;

View File

@ -6,6 +6,7 @@ using Syntriax.Engine.Core.Abstract;
namespace Syntriax.Engine.Physics2D.Primitives;
[System.Diagnostics.DebuggerDisplay("Vertices Count: {Vertices.Count()}")]
public readonly struct Shape(IList<Vector2D> Vertices) : IEnumerable<Vector2D>
{
public static readonly Shape Triangle = CreateNgon(3, Vector2D.Up);

View File

@ -4,6 +4,7 @@ using Syntriax.Engine.Core;
namespace Syntriax.Engine.Physics2D.Primitives;
[System.Diagnostics.DebuggerDisplay("A: {A.ToString(), nq}, B: {B.ToString(), nq}, B: {C.ToString(), nq}")]
public readonly struct Triangle(Vector2D A, Vector2D B, Vector2D C)
{
public readonly Vector2D A { get; init; } = A;