PkmnLibSharp/PkmnLibSharp/Utilities/ResultChecker.cs

22 lines
708 B
C#

using System;
namespace PkmnLibSharp.Utilities
{
internal static class ResultChecker
{
internal static void Assert(this byte result)
{
switch (result)
{
case 0: return;
case 1:
throw new NativeException("CreatureLib",
Creatureliblibrary.Generated.C.GetLastException().PtrString());
case 2:
throw new NativeException("PkmnLib", Pkmnlib.Generated.C.GetLastException().PtrString());
case 3:
throw new NativeException("Arbutils", Arbutils.Generated.C.GetLastException().PtrString());
}
}
}
}