Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
BoundingSphereHumanReadableConverter.cs
浏览该文件的文档.
1namespace Engine.Serialization {
2 [HumanReadableConverter(typeof(BoundingSphere))]
4 public string ConvertToString(object value) {
5 BoundingSphere boundingSphere = (BoundingSphere)value;
6 return HumanReadableConverter.ValuesListToString(
7 ',',
8 boundingSphere.Center.X,
9 boundingSphere.Center.Y,
10 boundingSphere.Center.Z,
11 boundingSphere.Radius
12 );
13 }
14
15 public object ConvertFromString(Type type, string data) {
16 float[] array = HumanReadableConverter.ValuesListFromString<float>(',', data);
17 return array.Length == 4 ? (object)new BoundingSphere(new Vector3(array[0], array[1], array[2]), array[3]) : throw new Exception();
18 }
19 }
20}
Engine.Vector3 Vector3