Steam
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | Events | List of all members
LapinerTools.Steam.SteamMainBase< SteamMainT > Class Template Reference

SteamMainBase is derived by all Steam APIs of the Easy Steamworks Integration Unity plugin. Derive from this class if you want to create a Steam API based on the Easy Steamworks Integration structure. Use this class to handle Steam errors, execute Steam API calls, handle call results and keep track of pending API calls. More...

Inherits MonoBehaviour.

Public Member Functions

void Execute< T > (SteamAPICall_t p_steamCall, CallResult< T >.APIDispatchDelegate p_onCompleted)
 The Execute method will handle Steam CallResult creation and storage. Simply pass the configured SteamAPICall and the callback that you want to be invoked when the work is done. Pending results can be viewed in the console with SteamMainBase.IsDebugLogEnabled set to true. More...
 

Protected Member Functions

virtual void OnDisable ()
 
virtual void LateUpdate ()
 
virtual bool CheckAndLogResultNoEvent< Trequest > (string p_logText, EResult p_result, bool p_bIOFailure)
 
virtual bool CheckAndLogResult< Trequest, Tevent > (string p_logText, EResult p_result, bool p_bIOFailure, string p_eventName, ref System.Action< Tevent > p_event)
 
virtual void HandleError (string p_logPrefix, ErrorEventArgs p_error)
 
virtual void InvokeEventHandlerSafely< T > (System.Action< T > p_handler, T p_data)
 
virtual void SetSingleShotEventHandler< T > (string p_eventName, ref System.Action< T > p_event, System.Action< T > p_handler)
 
virtual void CallSingleShotEventHandlers< T > (string p_eventName, T p_args, ref System.Action< T > p_event)
 
virtual void ClearSingleShotEventHandlers< T > (string p_eventName, ref System.Action< T > p_event)
 

Protected Attributes

SteamRequestList m_pendingRequests = new SteamRequestList()
 
object m_lock = new object()
 
bool m_isDebugLogEnabled = false
 

Static Protected Attributes

static SteamMainT s_instance
 

Properties

static SteamMainT Instance [get]
 You can use the static Instance property to access the Steam API from wherever you need it in your code. See also SteamMainBase.IsInstanceSet. More...
 
static bool IsInstanceSet [get]
 The static IsInstanceSet property can be used before accessing the Instance property to prevent a new instance from being created in the teardown phase. For example, if you want to unregister from an event, then first check that IsInstanceSet is true. If it is false, then your event registration is not valid anymore. More...
 
bool IsDebugLogEnabled [get, set]
 Set this property to true if you want to see a detailed log in the console. Disabled by default. More...
 

Events

System.Action< ErrorEventArgsOnError
 Invoked when a Steam error has occured. More...
 

Detailed Description

SteamMainBase is derived by all Steam APIs of the Easy Steamworks Integration Unity plugin. Derive from this class if you want to create a Steam API based on the Easy Steamworks Integration structure. Use this class to handle Steam errors, execute Steam API calls, handle call results and keep track of pending API calls.

Type Constraints
SteamMainT :SteamMainBase<SteamMainT> 

Member Function Documentation

◆ CallSingleShotEventHandlers< T >()

virtual void LapinerTools.Steam.SteamMainBase< SteamMainT >.CallSingleShotEventHandlers< T > ( string  p_eventName,
p_args,
ref System.Action< T >  p_event 
)
protectedvirtual

◆ CheckAndLogResult< Trequest, Tevent >()

virtual bool LapinerTools.Steam.SteamMainBase< SteamMainT >.CheckAndLogResult< Trequest, Tevent > ( string  p_logText,
EResult  p_result,
bool  p_bIOFailure,
string  p_eventName,
ref System.Action< Tevent >  p_event 
)
protectedvirtual

◆ CheckAndLogResultNoEvent< Trequest >()

virtual bool LapinerTools.Steam.SteamMainBase< SteamMainT >.CheckAndLogResultNoEvent< Trequest > ( string  p_logText,
EResult  p_result,
bool  p_bIOFailure 
)
protectedvirtual

◆ ClearSingleShotEventHandlers< T >()

virtual void LapinerTools.Steam.SteamMainBase< SteamMainT >.ClearSingleShotEventHandlers< T > ( string  p_eventName,
ref System.Action< T >  p_event 
)
protectedvirtual

◆ Execute< T >()

void LapinerTools.Steam.SteamMainBase< SteamMainT >.Execute< T > ( SteamAPICall_t  p_steamCall,
CallResult< T >.APIDispatchDelegate  p_onCompleted 
)

The Execute method will handle Steam CallResult creation and storage. Simply pass the configured SteamAPICall and the callback that you want to be invoked when the work is done. Pending results can be viewed in the console with SteamMainBase.IsDebugLogEnabled set to true.

Parameters
p_steamCallthe configured SteamAPICall.
p_onCompletedinvoked when the work is done.
Template Parameters
TThe CallResult type.

◆ HandleError()

virtual void LapinerTools.Steam.SteamMainBase< SteamMainT >.HandleError ( string  p_logPrefix,
ErrorEventArgs  p_error 
)
protectedvirtual

◆ InvokeEventHandlerSafely< T >()

virtual void LapinerTools.Steam.SteamMainBase< SteamMainT >.InvokeEventHandlerSafely< T > ( System.Action< T >  p_handler,
p_data 
)
protectedvirtual

◆ LateUpdate()

virtual void LapinerTools.Steam.SteamMainBase< SteamMainT >.LateUpdate ( )
protectedvirtual

◆ OnDisable()

virtual void LapinerTools.Steam.SteamMainBase< SteamMainT >.OnDisable ( )
protectedvirtual

◆ SetSingleShotEventHandler< T >()

virtual void LapinerTools.Steam.SteamMainBase< SteamMainT >.SetSingleShotEventHandler< T > ( string  p_eventName,
ref System.Action< T >  p_event,
System.Action< T >  p_handler 
)
protectedvirtual

Member Data Documentation

◆ m_isDebugLogEnabled

bool LapinerTools.Steam.SteamMainBase< SteamMainT >.m_isDebugLogEnabled = false
protected

◆ m_lock

object LapinerTools.Steam.SteamMainBase< SteamMainT >.m_lock = new object()
protected

◆ m_pendingRequests

SteamRequestList LapinerTools.Steam.SteamMainBase< SteamMainT >.m_pendingRequests = new SteamRequestList()
protected

◆ s_instance

SteamMainT LapinerTools.Steam.SteamMainBase< SteamMainT >.s_instance
staticprotected

Property Documentation

◆ Instance

SteamMainT LapinerTools.Steam.SteamMainBase< SteamMainT >.Instance
staticget

You can use the static Instance property to access the Steam API from wherever you need it in your code. See also SteamMainBase.IsInstanceSet.

◆ IsDebugLogEnabled

bool LapinerTools.Steam.SteamMainBase< SteamMainT >.IsDebugLogEnabled
getset

Set this property to true if you want to see a detailed log in the console. Disabled by default.

◆ IsInstanceSet

bool LapinerTools.Steam.SteamMainBase< SteamMainT >.IsInstanceSet
staticget

The static IsInstanceSet property can be used before accessing the Instance property to prevent a new instance from being created in the teardown phase. For example, if you want to unregister from an event, then first check that IsInstanceSet is true. If it is false, then your event registration is not valid anymore.

Event Documentation

◆ OnError

System.Action<ErrorEventArgs> LapinerTools.Steam.SteamMainBase< SteamMainT >.OnError

Invoked when a Steam error has occured.


The documentation for this class was generated from the following file: