refactor: code styles enforced with .editorconfig

This commit is contained in:
2025-03-17 21:32:37 +03:00
parent d71c135491
commit 9af44d48b3
22 changed files with 243 additions and 48 deletions

View File

@@ -1,5 +1,4 @@
using System;
using Syntriax.Engine.Core.Abstract;
namespace Syntriax.Engine.Core.Exceptions;
@@ -11,7 +10,7 @@ public class AssignException : Exception
// public static AssignException FromStateEnable(IStateEnable? stateEnable)
// => new AssignException($"{nameof(IGameObject.AssignStateEnable)} failed on type {stateEnable?.GetType().ToString() ?? "\"null\""}");
public static AssignException From<T, T2>(T to, T2? value)
=> new AssignException($"Assign operation has failed on T: {typeof(T).FullName}, value: {value?.GetType().ToString() ?? "\"null\""}");
=> new($"Assign operation has failed on T: {typeof(T).FullName}, value: {value?.GetType().ToString() ?? "\"null\""}");
// public static AssignException FromBehaviourController(IBehaviourController? behaviourController)
// => new AssignException($"{nameof(IGameObject.AssignBehaviourController)} failed on type {behaviourController?.GetType().ToString() ?? "\"null\""}");
}

View File

@@ -9,7 +9,7 @@ public class NotAssignedException : Exception
public NotAssignedException(string? message) : base(message) { }
public static NotAssignedException From<T1, T2>(T1 to, T2? value) where T1 : IAssignable
=> new NotAssignedException($"{typeof(T2).Name} has not been assigned to {typeof(T1).Name}");
=> new($"{typeof(T2).Name} has not been assigned to {typeof(T1).Name}");
public static void Check<T1, T2>(T1 to, T2? value) where T1 : IAssignable
{