Style cleanup
This commit is contained in:
@@ -64,7 +64,7 @@ public class ScriptRegistry
|
||||
// This is more performant than using Activator.CreateInstance.
|
||||
_scriptTypes[(category, name)] = Expression.Lambda<Func<Script>>(Expression.New(constructor)).Compile();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Register an item script type with the given name.
|
||||
/// </summary>
|
||||
@@ -83,32 +83,32 @@ public class ScriptRegistry
|
||||
// This is more performant than using Activator.CreateInstance.
|
||||
var parameterExpression = Expression.Parameter(typeof(IItem), "item");
|
||||
var newExpression = Expression.New(constructor, parameterExpression);
|
||||
_itemScriptTypes[name] = Expression.Lambda<Func<IItem, ItemScript>>(newExpression, parameterExpression).Compile();
|
||||
_itemScriptTypes[name] =
|
||||
Expression.Lambda<Func<IItem, ItemScript>>(newExpression, parameterExpression).Compile();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register a battle stat calculator.
|
||||
/// </summary>
|
||||
public void RegisterBattleStatCalculator<T>(T battleStatCalculator)
|
||||
where T : IBattleStatCalculator => _battleStatCalculator = battleStatCalculator;
|
||||
public void RegisterBattleStatCalculator<T>(T battleStatCalculator) where T : IBattleStatCalculator =>
|
||||
_battleStatCalculator = battleStatCalculator;
|
||||
|
||||
/// <summary>
|
||||
/// Register a damage calculator.
|
||||
/// </summary>
|
||||
public void RegisterDamageCalculator<T>(T damageCalculator)
|
||||
where T : IDamageCalculator => _damageCalculator = damageCalculator;
|
||||
public void RegisterDamageCalculator<T>(T damageCalculator) where T : IDamageCalculator =>
|
||||
_damageCalculator = damageCalculator;
|
||||
|
||||
/// <summary>
|
||||
/// Register a misc library.
|
||||
/// </summary>
|
||||
public void RegisterMiscLibrary<T>(T miscLibrary) where T : IMiscLibrary
|
||||
=> _miscLibrary = miscLibrary;
|
||||
|
||||
public void RegisterMiscLibrary<T>(T miscLibrary) where T : IMiscLibrary => _miscLibrary = miscLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// Register a capture library.
|
||||
/// </summary>
|
||||
public void RegisterCaptureLibrary<T>(T captureLibrary) where T : ICaptureLibrary
|
||||
=> _captureLibrary = captureLibrary;
|
||||
public void RegisterCaptureLibrary<T>(T captureLibrary) where T : ICaptureLibrary =>
|
||||
_captureLibrary = captureLibrary;
|
||||
|
||||
internal IReadOnlyDictionary<(ScriptCategory category, StringKey name), Func<Script>> ScriptTypes => _scriptTypes;
|
||||
internal IReadOnlyDictionary<StringKey, Func<IItem, ItemScript>> ItemScriptTypes => _itemScriptTypes;
|
||||
|
||||
Reference in New Issue
Block a user