/* * Copyright (C) SapphireCode - All Rights Reserved * This file is part of Snippeteer which is released under BSD-3-Clause. * See file 'LICENSE' for full license details. * Created by Timo Hocker , June 2020 */ import { PatchAction } from '../classes/PatchAction'; export class ActionFactory { private static _actions: RecordPatchAction> = {}; public static get (name:string, json:string): PatchAction { return this._actions[name] (json); } public static register ( name:string, constr: (json:string)=>PatchAction ):void { this._actions[name] = constr; } }