feat: Find & FindRequired for general type search

This commit is contained in:
2025-05-25 12:59:37 +03:00
parent bcce427376
commit 114fa82b9d
5 changed files with 46 additions and 16 deletions

View File

@@ -1,9 +1,3 @@
using System;
namespace Syntriax.Engine.Core.Exceptions;
public class BehaviourNotFoundException(string? message) : Exception(message)
{
public static NotAssignedException FromType<TBehaviour>()
=> new($"{typeof(TBehaviour).FullName} was not found");
}
public class BehaviourNotFoundException(string? message) : NotFoundException(message);

View File

@@ -0,0 +1,9 @@
using System;
namespace Syntriax.Engine.Core.Exceptions;
public class NotFoundException(string? message) : Exception(message)
{
public static NotAssignedException FromType<T>()
=> new($"{typeof(T).FullName} was not found");
}

View File

@@ -1,9 +1,3 @@
using System;
namespace Syntriax.Engine.Core.Exceptions;
public class UniverseObjectNotFoundException(string? message) : Exception(message)
{
public static NotAssignedException FromType<TUniverseObject>()
=> new($"{typeof(TUniverseObject).FullName} was not found");
}
public class UniverseObjectNotFoundException(string? message) : NotFoundException(message);