先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
53 lines
1.3 KiB
C#
53 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Bright.Common
|
|
{
|
|
public static class StringUtil
|
|
{
|
|
public static string ToStr(object o)
|
|
{
|
|
return ToStr(o, new StringBuilder());
|
|
}
|
|
|
|
public static string ToStr(object o, StringBuilder sb)
|
|
{
|
|
foreach (var p in o.GetType().GetFields())
|
|
{
|
|
|
|
sb.Append($"{p.Name} = {p.GetValue(o)},");
|
|
}
|
|
|
|
foreach (var p in o.GetType().GetProperties())
|
|
{
|
|
sb.Append($"{p.Name} = {p.GetValue(o)},");
|
|
}
|
|
return sb.ToString();
|
|
}
|
|
|
|
public static string ArrayToString<T>(T[] arr)
|
|
{
|
|
return "[" + string.Join(",", arr) + "]";
|
|
}
|
|
|
|
|
|
public static string CollectionToString<T>(IEnumerable<T> arr)
|
|
{
|
|
return "[" + string.Join(",", arr) + "]";
|
|
}
|
|
|
|
|
|
public static string CollectionToString<TK, TV>(IDictionary<TK, TV> dic)
|
|
{
|
|
var sb = new StringBuilder('{');
|
|
foreach (var e in dic)
|
|
{
|
|
sb.Append(e.Key).Append(':');
|
|
sb.Append(e.Value).Append(',');
|
|
}
|
|
sb.Append('}');
|
|
return sb.ToString();
|
|
}
|
|
}
|
|
}
|