Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
BoxHumanReadableConverter.cs
浏览该文件的文档.
1namespace Engine.Serialization {
2 [HumanReadableConverter(typeof(Box))]
4 public string ConvertToString(object value) {
5 Box box = (Box)value;
6 return HumanReadableConverter.ValuesListToString(
7 ',',
8 box.Left,
9 box.Top,
10 box.Near,
11 box.Width,
12 box.Height,
13 box.Depth
14 );
15 }
16
17 public object ConvertFromString(Type type, string data) {
18 int[] array = HumanReadableConverter.ValuesListFromString<int>(',', data);
19 return array.Length == 6 ? (object)new Box(array[0], array[1], array[2], array[3], array[4], array[5]) : throw new Exception();
20 }
21 }
22}
int Width
定义 Box.cs:9