using System;
using NodeNetwork.ViewModels;
namespace NodeNetwork.Toolkit
{
///
/// Used in systems that need an example of a type of node as well as a way to create more instances of the same type.
///
public class NodeTemplate
{
///
/// Factory function to create a new instance of the same type of node as Instance
///
public Func Factory { get; }
///
/// Example instance of the type of node created by Factory
///
public NodeViewModel Instance { get; }
public NodeTemplate(Func factory)
{
Factory = factory;
Instance = factory();
}
}
}