TapCommon-Unity/Runtime/Internal/Duration/Wrapper/Game.cs

107 lines
3.8 KiB
C#
Raw Normal View History

2023-11-08 10:47:27 +08:00
//------------------------------------------------------------------------------
// <auto-generated />
//
// This file was automatically generated by SWIG (http://www.swig.org).
// Version 4.0.2
//
// Do not make changes to this file unless you know what you are doing--modify
// the SWIG interface file instead.
//------------------------------------------------------------------------------
namespace com.taptap.tapsdk.bindings.csharp {
public class Game : global::System.IDisposable {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private bool swigCMemOwnBase;
internal Game(global::System.IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwnBase = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Game obj) {
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
}
~Game() {
Dispose(false);
}
public void Dispose() {
Dispose(true);
global::System.GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing) {
lock(this) {
if (swigCPtr.Handle != global::System.IntPtr.Zero) {
if (swigCMemOwnBase) {
swigCMemOwnBase = false;
TapSDKPINVOKE.delete_Game(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
}
}
}
public static void SetCurrent(Game game) {
TapSDKPINVOKE.Game_SetCurrent(Game.getCPtr(game));
if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve();
}
public static Game GetCurrent() {
global::System.IntPtr cPtr = TapSDKPINVOKE.Game_GetCurrent();
Game ret = (cPtr == global::System.IntPtr.Zero) ? null : new Game(cPtr, true);
return ret;
}
public virtual string GetGameID() {
string ret = TapSDKPINVOKE.Game_GetGameID(swigCPtr);
if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public virtual string GetPackageName() {
string ret = TapSDKPINVOKE.Game_GetPackageName(swigCPtr);
if (TapSDKPINVOKE.SWIGPendingException.Pending) throw TapSDKPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public Game() : this(TapSDKPINVOKE.new_Game(), true) {
SwigDirectorConnect();
}
private void SwigDirectorConnect() {
if (SwigDerivedClassHasMethod("GetGameID", swigMethodTypes0))
swigDelegate0 = new SwigDelegateGame_0(SwigDirectorMethodGetGameID);
if (SwigDerivedClassHasMethod("GetPackageName", swigMethodTypes1))
swigDelegate1 = new SwigDelegateGame_1(SwigDirectorMethodGetPackageName);
TapSDKPINVOKE.Game_director_connect(swigCPtr, swigDelegate0, swigDelegate1);
}
private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
global::System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance, null, methodTypes, null);
bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(Game));
return hasDerivedMethod;
}
private string SwigDirectorMethodGetGameID() {
return GetGameID();
}
private string SwigDirectorMethodGetPackageName() {
return GetPackageName();
}
public delegate string SwigDelegateGame_0();
public delegate string SwigDelegateGame_1();
private SwigDelegateGame_0 swigDelegate0;
private SwigDelegateGame_1 swigDelegate1;
private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { };
}
}