You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
971 B
32 lines
971 B
using System;
|
|
using JetBrains.Annotations;
|
|
using TNodeCore.Models;
|
|
using TNodeCore.Runtime.Interfaces;
|
|
|
|
namespace TNodeCore.Attribute{
|
|
/// <summary>
|
|
/// Use this attribute to claim the usage of a type derived IModel IModel
|
|
/// it can be applied to the same node multiple times.
|
|
/// <example>
|
|
/// [GraphUsage(DialogueGraph)]
|
|
/// </example>
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Class)]
|
|
[UsedImplicitly]
|
|
[MeansImplicitUse]
|
|
public class GraphUsageAttribute:System.Attribute{
|
|
public readonly Type GraphDataType;
|
|
public string Category;
|
|
public GraphUsageAttribute(Type t,string category = "default"){
|
|
//check if the type t is graph
|
|
if(!typeof(GraphData).IsAssignableFrom(t)){
|
|
throw new Exception("The type used on Graph Usage must be a graph");
|
|
}
|
|
GraphDataType = t;
|
|
Category = category;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
} |