17 lines
727 B
C#
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));
|
|
}
|
|
}
|
|
}
|
|
}
|