mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
23 lines
611 B
C#
23 lines
611 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
namespace BehaviorTreeSlayer
|
|
{
|
|
public class SlayerUtils
|
|
{
|
|
static Dictionary<Type, Func<string, object>> dic = new Dictionary<Type, Func<string, object>>();
|
|
public static Dictionary<Type, Func<string, object>> Dic => dic;
|
|
public static void RegistCustomParser<T>(Func<string, object> func)
|
|
{
|
|
Type key = typeof(T);
|
|
if (dic.ContainsKey(key))
|
|
{
|
|
dic[key] = func;
|
|
}
|
|
else
|
|
{
|
|
dic.Add(key, func);
|
|
}
|
|
}
|
|
}
|
|
|
|
} |