Enforce new() constraint on ConfigFile<TSettings>
This commit is contained in:
parent
96d7d2c54a
commit
50c1b757be
3 changed files with 2 additions and 12 deletions
|
|
@ -8,12 +8,12 @@ namespace TShockAPI.Configuration
|
|||
/// Implements <see cref="IConfigFile{TSettings}"/> to provide a generic config file containing some settings
|
||||
/// </summary>
|
||||
/// <typeparam name="TSettings"></typeparam>
|
||||
public class ConfigFile<TSettings> : IConfigFile<TSettings>
|
||||
public class ConfigFile<TSettings> : IConfigFile<TSettings> where TSettings : new()
|
||||
{
|
||||
/// <summary>
|
||||
/// Settings managed by this config file
|
||||
/// </summary>
|
||||
public virtual TSettings Settings { get; set; }
|
||||
public virtual TSettings Settings { get; set; } = new TSettings();
|
||||
|
||||
/// <summary>
|
||||
/// Action invoked when the config file is read
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue