port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using System;
using NodeNetwork.ViewModels;
namespace NodeNetwork.Toolkit
{
/// <summary>
/// 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.
/// </summary>
public class NodeTemplate
{
/// <summary>
/// Factory function to create a new instance of the same type of node as Instance
/// </summary>
public Func<NodeViewModel> Factory { get; }
/// <summary>
/// Example instance of the type of node created by Factory
/// </summary>
public NodeViewModel Instance { get; }
public NodeTemplate(Func<NodeViewModel> factory)
{
Factory = factory;
Instance = factory();
}
}
}