Files
Firebird_2D/Firebird2D.Requirement/Require.cs
T
2025-02-23 14:29:32 +01:00

17 lines
727 B
C#

using Firebird2D.Logger;
using System.Runtime.CompilerServices;
namespace Firebird2D.Requirement
{
public class Require
{
public static void NotNull(object input, string name, [CallerMemberName] string callerName = "", [CallerFilePath] string callerPath = "", [CallerLineNumber] int callerLineNumber = 0)
{
if (input == null) {
GameLogger.Log(callerName, LogType.Error, string.Format("{0}, was Null at Line {1} in {2} from {3}.", name, callerLineNumber, callerName, callerPath));
throw new ArgumentNullException(string.Format("{0}, was Null at Line {1} in {2} from {3}.", name, callerLineNumber, callerName, callerPath));
}
}
}
}