Drag[en]gine Script Module DragonScript
1.23
|
Base class managing basic game services. More...
Public Member Functions | |
void | addInitializeService () |
Increment initialize service count by 1. More... | |
void | addModsService (ServiceMods service) |
Add modification service. More... | |
void | addStatsService (ServiceStats service) |
Add stats service. More... | |
void | addUserService (ServiceUser service) |
Add user service. More... | |
void | autoInitMsgdk () |
Automatically initialize Microsoft GDK if supported. More... | |
void | autoInitServices () |
Automatically initialize supported services. More... | |
void | autoInitSteam () |
Automatically initialize steam if supported. More... | |
void | closeEos () |
Close and dispose Eos service. More... | |
void | closeModio () |
Close and dispose Mod.io service. More... | |
void | closeMsgdk () |
Close and dispose Microsoft GDK service. More... | |
void | closeSteam () |
Close and dispose Steam service. More... | |
Array | collectModsService (Block ablock) |
Collect modification services using block. More... | |
Array | collectStatsService (Block ablock) |
Collect stats services using block. More... | |
Array | collectUserService (Block ablock) |
Collect user services using block. More... | |
void | dispose () |
Dispose of base game services. More... | |
ServiceMods | findModsService (Block ablock) |
Find modification services with block. More... | |
ServiceStats | findStatsService (Block ablock) |
Find stats services with block. More... | |
ServiceUser | findUserService (Block ablock) |
Find user services with block. More... | |
void | forEachModsService (Block ablock) |
Visit modification services with block. More... | |
void | forEachStatsService (Block ablock) |
Visit stats services with block. More... | |
void | forEachUserService (Block ablock) |
Visit user services with block. More... | |
Array | getAllModsServices () |
All modification services as Array of ServiceMods. More... | |
Array | getAllStatsServices () |
All stats services as Array of ServiceStats. More... | |
Array | getAllUserServices () |
All user services as Array of ServiceUser. More... | |
ServiceEos | getEos () |
int | getInitializeServiceCount () |
Count of services in progress of being initialized. More... | |
ServiceModio | getModio () |
int | getModsServiceCount () |
Count of initialized modification services. More... | |
ServiceMsgdk | getMsgdk () |
Microsoft GDK service or null. More... | |
ServiceSteam | getSteam () |
Steam service or null. More... | |
Array | getSupportedAuthProviders (Set ids) |
Find ServiceUser supported by another service for authentification. More... | |
int | getUserServiceCount () |
Count of initialized user services. More... | |
void | initEos (ServiceEos.InitParameters params, ServiceInitListener listener) |
Initialize EOS service. More... | |
void | initEos (ServiceInitListener listener) |
Initialize EOS service using parameters from configuration parameter tree. More... | |
void | initModio (ServiceInitListener listener) |
Initialize Mod.io service using parameters from configuration parameter tree. More... | |
void | initModio (ServiceModio.InitParameters params, ServiceInitListener listener) |
Initialize Mod.io service. More... | |
void | initMsgdk () |
Initialize Microsoft GDK service using parameters from configuration parameter tree. More... | |
void | initMsgdk (ServiceMsgdk.InitParameters params) |
Initialize Microsoft GDK service. More... | |
void | initSteam () |
Initialize Steam service using parameters from configuration parameter tree. More... | |
void | initSteam (ServiceSteam.InitParameters params) |
Initialize Steam service. More... | |
BaseGameServices | new () |
Create base game services instance using BaseGameApp.getApp(). More... | |
BaseGameServices | new (ParameterTree configuration, Console console) |
Create base game services instance. More... | |
void | removeInitializeService () |
Decrement initialize service count by 1. More... | |
void | removeModsService (ServiceMods service) |
Remove modification service if present. More... | |
void | removeStatsService (ServiceStats service) |
Remove stats service if present. More... | |
void | removeUserService (ServiceUser service) |
Remove user service if present. More... | |
void | setActionInitialized (ActionListener listener) |
Set action to be called if all services finished initialization. More... | |
Public Attributes | |
ActionListener | pActionInitialized |
ParameterTree | pConfiguration |
Console | pConsole |
ServiceEos | pEos |
int | pInitializeCount |
ServiceModio | pModio |
ServiceMsgdk | pMsgdk |
ServiceSteam | pSteam |
Array | pUser |
Base class managing basic game services.
Stores list of basic game services. User can request instances of supported services to be created. The user can either request them individually or all automatically. Supports services of implementing these interfaces:
See the documentation of the respective service create function for the parameters required to successfully start the service. The information is stored in the game configuration parameter tree. Supports being used by BaseGameApp and other base classes as long as the required object instances can be provided on construction time.
The user can set an action listener using setActionInitialized() to be notified once all services have finished initialize. If all services are already initialized the provided action is immediately run.
Make sue to call dispose() upon closing the game to properly clean up all service resources.
void Dragengine.Services.BaseGameServices.addInitializeService | ( | ) |
Increment initialize service count by 1.
void Dragengine.Services.BaseGameServices.addModsService | ( | ServiceMods | service | ) |
Add modification service.
void Dragengine.Services.BaseGameServices.addStatsService | ( | ServiceStats | service | ) |
Add stats service.
void Dragengine.Services.BaseGameServices.addUserService | ( | ServiceUser | service | ) |
Add user service.
void Dragengine.Services.BaseGameServices.autoInitMsgdk | ( | ) |
Automatically initialize Microsoft GDK if supported.
Initializes Microsoft GDK if all of the following conditions are fulfilled:
Failure to initialize is only logged and does not throw an exception.
void Dragengine.Services.BaseGameServices.autoInitServices | ( | ) |
Automatically initialize supported services.
Uses presence of configuration options and command line parameters to initialize all supported services.
Some service are asynchronously initialized and will be only available in the type specific lists once successfully initialized. Use getInitializeServiceCount() to know if there are still service initializing. Once all services finished initializing it is safe to examine which services are actually usable.
Failure to initialize services is only logged and does not throw exceptions.
The following services are supported:
Requires configuration parameters:
The user can set an action listener using setActionInitialized() to be notified once all services have finished initialize. If all services are already initialized the provided action is immediately run.
void Dragengine.Services.BaseGameServices.autoInitSteam | ( | ) |
Automatically initialize steam if supported.
Initializes Steam if all of the following conditions are fulfilled:
Failure to initialize is only logged and does not throw an exception.
void Dragengine.Services.BaseGameServices.closeEos | ( | ) |
Close and dispose Eos service.
Does nothing if service is not initialized.
void Dragengine.Services.BaseGameServices.closeModio | ( | ) |
Close and dispose Mod.io service.
Does nothing if service is not initialized.
void Dragengine.Services.BaseGameServices.closeMsgdk | ( | ) |
Close and dispose Microsoft GDK service.
Does nothing if service is not initialized.
void Dragengine.Services.BaseGameServices.closeSteam | ( | ) |
Close and dispose Steam service.
Does nothing if service is not initialized.
Array Dragengine.Services.BaseGameServices.collectModsService | ( | Block | ablock | ) |
Collect modification services using block.
Block receives as parameter ServiceMods and has to return true to include the service in the returned list or false to not include.
Array Dragengine.Services.BaseGameServices.collectStatsService | ( | Block | ablock | ) |
Collect stats services using block.
Block receives as parameter ServiceStats and has to return true to include the service in the returned list or false to not include.
Array Dragengine.Services.BaseGameServices.collectUserService | ( | Block | ablock | ) |
Collect user services using block.
Block receives as parameter ServiceUser and has to return true to include the service in the returned list or false to not include.
void Dragengine.Services.BaseGameServices.dispose | ( | ) |
Dispose of base game services.
ServiceMods Dragengine.Services.BaseGameServices.findModsService | ( | Block | ablock | ) |
Find modification services with block.
Block receives as parameter ServiceMods and has to return true if found or false otherwise.
ServiceStats Dragengine.Services.BaseGameServices.findStatsService | ( | Block | ablock | ) |
Find stats services with block.
Block receives as parameter ServiceStats and has to return true if found or false otherwise.
ServiceUser Dragengine.Services.BaseGameServices.findUserService | ( | Block | ablock | ) |
Find user services with block.
Block receives as parameter ServiceUser and has to return true if found or false otherwise.
void Dragengine.Services.BaseGameServices.forEachModsService | ( | Block | ablock | ) |
Visit modification services with block.
Block receives as parameter ServiceMods.
void Dragengine.Services.BaseGameServices.forEachStatsService | ( | Block | ablock | ) |
Visit stats services with block.
Block receives as parameter ServiceStats.
void Dragengine.Services.BaseGameServices.forEachUserService | ( | Block | ablock | ) |
Visit user services with block.
Block receives as parameter ServiceUser.
Array Dragengine.Services.BaseGameServices.getAllModsServices | ( | ) |
All modification services as Array of ServiceMods.
Array Dragengine.Services.BaseGameServices.getAllStatsServices | ( | ) |
All stats services as Array of ServiceStats.
Array Dragengine.Services.BaseGameServices.getAllUserServices | ( | ) |
All user services as Array of ServiceUser.
ServiceEos Dragengine.Services.BaseGameServices.getEos | ( | ) |
EOS service or null.
int Dragengine.Services.BaseGameServices.getInitializeServiceCount | ( | ) |
Count of services in progress of being initialized.
ServiceModio Dragengine.Services.BaseGameServices.getModio | ( | ) |
Mod.io service or null.
int Dragengine.Services.BaseGameServices.getModsServiceCount | ( | ) |
Count of initialized modification services.
ServiceMsgdk Dragengine.Services.BaseGameServices.getMsgdk | ( | ) |
Microsoft GDK service or null.
ServiceSteam Dragengine.Services.BaseGameServices.getSteam | ( | ) |
Steam service or null.
Array Dragengine.Services.BaseGameServices.getSupportedAuthProviders | ( | Set | ids | ) |
Find ServiceUser supported by another service for authentification.
Returns Array of ServiceUser.
ids | Set of String authentication provider identifiers. Get this set from feature instances obtained from the respective service. |
int Dragengine.Services.BaseGameServices.getUserServiceCount | ( | ) |
Count of initialized user services.
void Dragengine.Services.BaseGameServices.initEos | ( | ServiceEos.InitParameters | params, |
ServiceInitListener | listener | ||
) |
Initialize EOS service.
Once initialized successfully the service will be added to following type specific service lists:
params | Initialization parameters. |
listener | Listener to call if initialization finished or null. |
EInvalidParam | One or more parameter is invalid. |
EInvalidAction | EOS is already initialized. |
void Dragengine.Services.BaseGameServices.initEos | ( | ServiceInitListener | listener | ) |
Initialize EOS service using parameters from configuration parameter tree.
Requires these configuration parameters to be present:
Optional configuration paramenets:
Once initialized successfully the service will be added to following type specific service lists:
listener | Listener to call if initialization finished or null. |
EInvalidParam | One or more required configuration parameter is missing. |
EInvalidAction | EOS is already initialized. |
void Dragengine.Services.BaseGameServices.initModio | ( | ServiceInitListener | listener | ) |
Initialize Mod.io service using parameters from configuration parameter tree.
Requires these configuration parameters to be present:
Optional configuration parameters:
Portal is chosen depending on the initialized user services.
Once initialized successfully the service will be added to following type specific service lists:
listener | Listener to call if initialization finished or null. |
EInvalidParam | One or more required configuration parameter is missing. |
EInvalidAction | Mod.io is already initialized. |
void Dragengine.Services.BaseGameServices.initModio | ( | ServiceModio.InitParameters | params, |
ServiceInitListener | listener | ||
) |
Initialize Mod.io service.
Once initialized successfully the service will be added to following type specific service lists:
params | Initialization parameters |
listener | Listener to call if initialization finished or null. |
EInvalidParam | One or more parameter is invalid. |
EInvalidAction | Mod.io is already initialized. |
void Dragengine.Services.BaseGameServices.initMsgdk | ( | ) |
Initialize Microsoft GDK service using parameters from configuration parameter tree.
Requires these configuration parameters to be present:
Service will be added to the following type specific service lists:
EInvalidParam | One or more required configuration parameter is missing. |
EInvalidAction | Microsoft GDK is already initialized. |
void Dragengine.Services.BaseGameServices.initMsgdk | ( | ServiceMsgdk.InitParameters | params | ) |
void Dragengine.Services.BaseGameServices.initSteam | ( | ) |
Initialize Steam service using parameters from configuration parameter tree.
Requires these configuration parameters to be present:
Service will be added to the following type specific service lists:
EInvalidParam | One or more required configuration parameter is missing. |
EInvalidAction | Steam is already initialized. |
void Dragengine.Services.BaseGameServices.initSteam | ( | ServiceSteam.InitParameters | params | ) |
BaseGameServices Dragengine.Services.BaseGameServices.new | ( | ) |
Create base game services instance using BaseGameApp.getApp().
BaseGameServices Dragengine.Services.BaseGameServices.new | ( | ParameterTree | configuration, |
Console | console | ||
) |
Create base game services instance.
void Dragengine.Services.BaseGameServices.removeInitializeService | ( | ) |
Decrement initialize service count by 1.
void Dragengine.Services.BaseGameServices.removeModsService | ( | ServiceMods | service | ) |
Remove modification service if present.
void Dragengine.Services.BaseGameServices.removeStatsService | ( | ServiceStats | service | ) |
Remove stats service if present.
void Dragengine.Services.BaseGameServices.removeUserService | ( | ServiceUser | service | ) |
Remove user service if present.
void Dragengine.Services.BaseGameServices.setActionInitialized | ( | ActionListener | listener | ) |
Set action to be called if all services finished initialization.
If all services are already initialized the provided action is immediately run. Listener can be null in which case the listener is cleared.
ActionListener Dragengine.Services.BaseGameServices.pActionInitialized |
ParameterTree Dragengine.Services.BaseGameServices.pConfiguration |
Console Dragengine.Services.BaseGameServices.pConsole |
ServiceEos Dragengine.Services.BaseGameServices.pEos |
int Dragengine.Services.BaseGameServices.pInitializeCount |
ServiceModio Dragengine.Services.BaseGameServices.pModio |
ServiceMsgdk Dragengine.Services.BaseGameServices.pMsgdk |
ServiceSteam Dragengine.Services.BaseGameServices.pSteam |
Array Dragengine.Services.BaseGameServices.pUser |