Interface IGameConfigurationExtension
Provides IConfigurationCollection<T> access to IGames.
Namespace: Snowflake.Model.Game.LibraryExtensions
Assembly: Snowflake.Framework.Primitives.dll
Syntax
public interface IGameConfigurationExtension : IGameExtension
Methods
CreateNewProfile<T>(String, String)
Creates a new IConfigurationCollection<T> profile for this game.
Configurations are unique on their sourceName
and profile
,
NOT their prototype T
.
In fact, it is possible, but highly not recommended, to have one IConfigurationCollection<T>, to
be interpreted differently as different prototypes.
Declaration
IConfigurationCollection<T> CreateNewProfile<T>(string sourceName, string profile)
where T : class, IConfigurationCollection<T>
Parameters
Type | Name | Description |
---|---|---|
System. |
sourceName | The name of the emulator plugin, or whatever is the source or creator of this profile. This is to avoid namespacing conflicts between emulator plugins that share a configuration prototype. |
System. |
profile | The name of the configuration profile. |
Returns
Type | Description |
---|---|
IConfiguration |
A new configuration profile . If a configuration profile with the same source name and profile name exist, this will throw an exception. |
Type Parameters
Name | Description |
---|---|
T | The prototype of the configuration. |
CreateNewProfileAsync<T>(String, String)
Asychronously creates a new IConfigurationCollection<T> profile for this game.
Configurations are unique on their sourceName
and profile
,
NOT their prototype T
.
In fact, it is possible, but highly not recommended, to have one IConfigurationCollection<T>, to
be interpreted differently as different prototypes.
Declaration
Task<IConfigurationCollection<T>> CreateNewProfileAsync<T>(string sourceName, string profile)
where T : class, IConfigurationCollection<T>
Parameters
Type | Name | Description |
---|---|---|
System. |
sourceName | The name of the emulator plugin, or whatever is the source or creator of this profile. This is to avoid namespacing conflicts between emulator plugins that share a configuration prototype. |
System. |
profile | The name of the configuration profile. |
Returns
Type | Description |
---|---|
System. |
A new configuration profile . If a configuration profile with the same source name and profile name exist, this will throw an exception. |
Type Parameters
Name | Description |
---|---|
T | The prototype of the configuration. |
DeleteProfile(String, Guid)
Deletes the profile with the given source name and profile.
Declaration
void DeleteProfile(string sourceName, Guid collectionGuid)
Parameters
Type | Name | Description |
---|---|---|
System. |
sourceName | The source name or name of creator of the profile. |
System. |
collectionGuid | The collection GUID of the profile. |
DeleteProfileAsync(String, Guid)
Asynchronously deletes the profile with the given source name and profile.
Declaration
Task DeleteProfileAsync(string sourceName, Guid collectionGuid)
Parameters
Type | Name | Description |
---|---|---|
System. |
sourceName | The source name or name of creator of the profile. |
System. |
collectionGuid | The collection GUID of the profile. |
Returns
Type | Description |
---|---|
System. |
GetProfile<T>(String, Guid)
Gets the specific, registered configuration profile with the given sourceName
,
collectionGuid
, and interprets the profile with the prototype T
Declaration
IConfigurationCollection<T> GetProfile<T>(string sourceName, Guid collectionGuid)
where T : class, IConfigurationCollection<T>
Parameters
Type | Name | Description |
---|---|---|
System. |
sourceName | The source or creator of this profile. |
System. |
collectionGuid | The profile name. |
Returns
Type | Description |
---|---|
IConfiguration |
The previously added configuration profile. If this can not be found, throws an exception. |
Type Parameters
Name | Description |
---|---|
T | The configuration prototype. |
GetProfileAsync<T>(String, Guid)
Asychronously gets the specific, registered configuration profile with the given sourceName
,
collectionGuid
, and interprets the profile with the prototype T
Declaration
Task<IConfigurationCollection<T>> GetProfileAsync<T>(string sourceName, Guid collectionGuid)
where T : class, IConfigurationCollection<T>
Parameters
Type | Name | Description |
---|---|---|
System. |
sourceName | The source or creator of this profile. |
System. |
collectionGuid | The profile name. |
Returns
Type | Description |
---|---|
System. |
The previously added configuration profile. If this can not be found, throws an exception. |
Type Parameters
Name | Description |
---|---|
T | The configuration prototype. |
GetProfileNames()
Gets all the names of profiles for this IGame, grouped by source.
Declaration
IEnumerable<IGrouping<string, (string profileName, Guid collectionGuid)>> GetProfileNames()
Returns
Type | Description |
---|---|
System. |
All the names of profiles for this IGame, grouped by source. |