コード例 #1
0
        public static Soul New(SoulType type, VLoadoutSouls collection)
        {
            if (type == SoulType.None)
            {
                return(new EmptySoul());
            }
            var soulName = type.AsString(EnumFormat.Name) + "Soul";
            var soulType = System.Type.GetType($"VBusiness.Souls.{soulName}");

            if (soulType == null)
            {
                ErrorReporter.ReportDebug($"Please create a class named VBusiness.Souls.{soulName}");
                return(new EmptySoul());
            }

            var soul = (Soul)Activator.CreateInstance(soulType, collection);

            return(soul);
        }
コード例 #2
0
 public static string GetDescription(this SoulType type)
 {
     return(type.AsString(EnumFormat.Description, EnumFormat.Name));
 }