ca2d-unity-toolkit/Assets/Main/Scripts/LoseRequirementException.cs
cardidi 0315862527 Add some basic features of this toolkit.
feat: Logg was almost done.
fix: Some impossible call was fixed in UnityObjectWarp.cs
feat: Boxing<T> was force to unbox by explicit cast operator.
2024-05-10 00:55:42 +08:00

28 lines
851 B
C#

using System;
namespace Ca2d.Toolkit
{
/// <summary>
/// When Unity Requirements did not fit <see cref="Guard"/> wants, throw this.
/// </summary>
public class LoseRequirementException : Exception
{
public Type RequiredType { get; }
public LoseRequirementException(Type type) : base($"Required type {type?.FullName} was lost when resolving.")
{
RequiredType = type;
}
public LoseRequirementException(Object obj) : base($"Required type {obj?.GetType().FullName} was lost when resolving.")
{
RequiredType = obj?.GetType();
}
public LoseRequirementException(ValueType obj) : base($"Required type {obj.GetType().FullName} was lost when resolving.")
{
RequiredType = obj.GetType();
}
}
}