Code Formatting - Replaced abs with 4 white spaces

This commit is contained in:
Jan Bubenik 2018-12-14 11:59:58 +01:00
parent b39f8edf7c
commit c1d9e2f856

View File

@ -6,9 +6,9 @@ using AOT;
public class DiscordRpc public class DiscordRpc
{ {
[MonoPInvokeCallback(typeof(OnReadyInfo))] [MonoPInvokeCallback(typeof(OnReadyInfo))]
public static void ReadyCallback(ref DiscordUser connectedUser) { Callbacks.readyCallback(ref connectedUser); } public static void ReadyCallback(ref DiscordUser connectedUser) { Callbacks.readyCallback(ref connectedUser); }
public delegate void OnReadyInfo(ref DiscordUser connectedUser); public delegate void OnReadyInfo(ref DiscordUser connectedUser);
[MonoPInvokeCallback(typeof(OnDisconnectedInfo))] [MonoPInvokeCallback(typeof(OnDisconnectedInfo))]
public static void DisconnectedCallback(int errorCode, string message) { Callbacks.disconnectedCallback(errorCode, message); } public static void DisconnectedCallback(int errorCode, string message) { Callbacks.disconnectedCallback(errorCode, message); }
@ -30,9 +30,9 @@ public class DiscordRpc
public static void RequestCallback(ref DiscordUser request) { Callbacks.requestCallback(ref request); } public static void RequestCallback(ref DiscordUser request) { Callbacks.requestCallback(ref request); }
public delegate void OnRequestInfo(ref DiscordUser request); public delegate void OnRequestInfo(ref DiscordUser request);
static EventHandlers Callbacks { get; set; } static EventHandlers Callbacks { get; set; }
public struct EventHandlers public struct EventHandlers
{ {
public OnReadyInfo readyCallback; public OnReadyInfo readyCallback;
public OnDisconnectedInfo disconnectedCallback; public OnDisconnectedInfo disconnectedCallback;
@ -77,23 +77,23 @@ public class DiscordRpc
Yes = 1, Yes = 1,
Ignore = 2 Ignore = 2
} }
public static void Initialize(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId)
{
Callbacks = handlers;
EventHandlers staticEventHandlers = new EventHandlers(); public static void Initialize(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId)
staticEventHandlers.readyCallback += DiscordRpc.ReadyCallback; {
staticEventHandlers.disconnectedCallback += DiscordRpc.DisconnectedCallback; Callbacks = handlers;
staticEventHandlers.errorCallback += DiscordRpc.ErrorCallback;
staticEventHandlers.joinCallback += DiscordRpc.JoinCallback;
staticEventHandlers.spectateCallback += DiscordRpc.SpectateCallback;
staticEventHandlers.requestCallback += DiscordRpc.RequestCallback;
InitializeInternal(applicationId, ref staticEventHandlers, autoRegister, optionalSteamId); EventHandlers staticEventHandlers = new EventHandlers();
} staticEventHandlers.readyCallback += DiscordRpc.ReadyCallback;
staticEventHandlers.disconnectedCallback += DiscordRpc.DisconnectedCallback;
staticEventHandlers.errorCallback += DiscordRpc.ErrorCallback;
staticEventHandlers.joinCallback += DiscordRpc.JoinCallback;
staticEventHandlers.spectateCallback += DiscordRpc.SpectateCallback;
staticEventHandlers.requestCallback += DiscordRpc.RequestCallback;
[DllImport("discord-rpc", EntryPoint = "Discord_Initialize", CallingConvention = CallingConvention.Cdecl)] InitializeInternal(applicationId, ref staticEventHandlers, autoRegister, optionalSteamId);
}
[DllImport("discord-rpc", EntryPoint = "Discord_Initialize", CallingConvention = CallingConvention.Cdecl)]
static extern void InitializeInternal(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId); static extern void InitializeInternal(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId);
[DllImport("discord-rpc", EntryPoint = "Discord_Shutdown", CallingConvention = CallingConvention.Cdecl)] [DllImport("discord-rpc", EntryPoint = "Discord_Shutdown", CallingConvention = CallingConvention.Cdecl)]