mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-05-22 18:25:31 +00:00
19 lines
454 B
C#
19 lines
454 B
C#
using System;
|
|
using PckStudio.Interfaces;
|
|
|
|
namespace PckStudio.Core
|
|
{
|
|
public class DelegatedSaveContext<T> : ISaveContext<T>
|
|
{
|
|
private readonly Action<T> _saveAction;
|
|
public bool AutoSave { get; }
|
|
|
|
public void Save(T value) => _saveAction(value);
|
|
|
|
public DelegatedSaveContext(bool autoSave, Action<T> saveAction)
|
|
{
|
|
AutoSave = autoSave;
|
|
_saveAction = saveAction;
|
|
}
|
|
}
|
|
} |