private void SwapRows(ArrayIndexes firstLetterIndexes, ArrayIndexes secondLetterIndexes) { var columnIndexToTransfer = firstLetterIndexes.ColumnIndex; firstLetterIndexes.ColumnIndex = secondLetterIndexes.ColumnIndex; secondLetterIndexes.ColumnIndex = columnIndexToTransfer; }
private CharPare GetCharePareByIndex(ArrayIndexes firstLetterIndexes, ArrayIndexes secondLetterIndexes) { return(new CharPare { FirstLetter = _key[firstLetterIndexes.RowIndex][firstLetterIndexes.ColumnIndex], LastLetter = _key[secondLetterIndexes.RowIndex][secondLetterIndexes.ColumnIndex], }); }
void SerializeValues() { var keyList = new List <string>(); var indexList = new List <int>(); var metadataList = new List <string>(); var intList = new List <int>(); var floatList = new List <float>(); var boolList = new List <bool>(); var stringList = new List <string>(); var vector3List = new List <Vector3>(); var colorList = new List <Color>(); var spaceList = new List <Space>(); var easeTypeList = new List <iTween.EaseType>(); var loopTypeList = new List <iTween.LoopType>(); var gameObjectList = new List <GameObject>(); var transformList = new List <Transform>(); var audioClipList = new List <AudioClip>(); var audioSourceList = new List <AudioSource>(); var vector3ArrayList = new List <ArrayIndexes>(); var transformArrayList = new List <ArrayIndexes>(); var textList = new List <Text>(); //-----omid----- var numberFormatList = new List <iTween.NumberFormat>(); //-----omid----- foreach (var pair in values) { var mappings = EventParamMappings.mappings[type]; var valueType = mappings[pair.Key]; if (typeof(int) == valueType) { AddToList <int>(keyList, indexList, intList, metadataList, pair); } if (typeof(float) == valueType) { AddToList <float>(keyList, indexList, floatList, metadataList, pair); } else if (typeof(bool) == valueType) { AddToList <bool>(keyList, indexList, boolList, metadataList, pair); } else if (typeof(string) == valueType) { AddToList <string>(keyList, indexList, stringList, metadataList, pair); } else if (typeof(Vector3) == valueType) { AddToList <Vector3>(keyList, indexList, vector3List, metadataList, pair); } else if (typeof(Color) == valueType) { AddToList <Color>(keyList, indexList, colorList, metadataList, pair); } else if (typeof(Space) == valueType) { AddToList <Space>(keyList, indexList, spaceList, metadataList, pair); } else if (typeof(iTween.EaseType) == valueType) { AddToList <iTween.EaseType>(keyList, indexList, easeTypeList, metadataList, pair); } else if (typeof(iTween.LoopType) == valueType) { AddToList <iTween.LoopType>(keyList, indexList, loopTypeList, metadataList, pair); } else if (typeof(iTween.NumberFormat) == valueType) { AddToList <iTween.NumberFormat>(keyList, indexList, numberFormatList, metadataList, pair); } else if (typeof(GameObject) == valueType) { AddToList <GameObject>(keyList, indexList, gameObjectList, metadataList, pair); } else if (typeof(Transform) == valueType) { AddToList <Transform>(keyList, indexList, transformList, metadataList, pair); } else if (typeof(AudioClip) == valueType) { AddToList <AudioClip>(keyList, indexList, audioClipList, metadataList, pair); } else if (typeof(AudioSource) == valueType) { AddToList <AudioSource>(keyList, indexList, audioSourceList, metadataList, pair); } else if (typeof(Text) == valueType) { AddToList <Text>(keyList, indexList, textList, metadataList, pair); } else if (typeof(Vector3OrTransform) == valueType) { if (pair.Value == null || typeof(Transform) == pair.Value.GetType()) { AddToList <Transform>(keyList, indexList, transformList, metadataList, pair.Key, pair.Value, "t"); } else { AddToList <Vector3>(keyList, indexList, vector3List, metadataList, pair.Key, pair.Value, "v"); } } else if (typeof(Vector3OrTransformArray) == valueType) { if (typeof(Vector3[]) == pair.Value.GetType()) { var value = (Vector3[])pair.Value; var vectorIndexes = new ArrayIndexes(); var indexArray = new int[value.Length]; for (var i = 0; i < value.Length; ++i) { vector3List.Add((Vector3)value[i]); indexArray[i] = vector3List.Count - 1; } vectorIndexes.indexes = indexArray; AddToList <ArrayIndexes>(keyList, indexList, vector3ArrayList, metadataList, pair.Key, vectorIndexes, "v"); } else if (typeof(Transform[]) == pair.Value.GetType()) { var value = (Transform[])pair.Value; var transformIndexes = new ArrayIndexes(); var indexArray = new int[value.Length]; for (var i = 0; i < value.Length; ++i) { transformList.Add((Transform)value[i]); indexArray[i] = transformList.Count - 1; } transformIndexes.indexes = indexArray; AddToList <ArrayIndexes>(keyList, indexList, transformArrayList, metadataList, pair.Key, transformIndexes, "t"); } else if (typeof(string) == pair.Value.GetType()) { AddToList <string>(keyList, indexList, stringList, metadataList, pair.Key, pair.Value, "p"); } } } keys = keyList.ToArray(); indexes = indexList.ToArray(); metadatas = metadataList.ToArray(); ints = intList.ToArray(); floats = floatList.ToArray(); bools = boolList.ToArray(); strings = stringList.ToArray(); vector3s = vector3List.ToArray(); colors = colorList.ToArray(); spaces = spaceList.ToArray(); easeTypes = easeTypeList.ToArray(); loopTypes = loopTypeList.ToArray(); gameObjects = gameObjectList.ToArray(); transforms = transformList.ToArray(); audioClips = audioClipList.ToArray(); audioSources = audioSourceList.ToArray(); vector3Arrays = vector3ArrayList.ToArray(); transformArrays = transformArrayList.ToArray(); texts = textList.ToArray(); //-----omid----- numberFormats = numberFormatList.ToArray(); //----omid---- }
private void DeserializeValues() { values = new Dictionary <string, object>(); if (keys == null) { return; } for (int i = 0; i < keys.Length; i++) { Dictionary <string, Type> dictionary = EventParamMappings.mappings[this.type]; Type type = dictionary[keys[i]]; if (typeof(int) == type) { values.Add(keys[i], ints[indexes[i]]); } else if (typeof(float) == type) { values.Add(keys[i], floats[indexes[i]]); } else if (typeof(bool) == type) { values.Add(keys[i], bools[indexes[i]]); } else if (typeof(string) == type) { values.Add(keys[i], strings[indexes[i]]); } else if (typeof(Vector3) == type) { values.Add(keys[i], vector3s[indexes[i]]); } else if (typeof(Color) == type) { values.Add(keys[i], colors[indexes[i]]); } else if (typeof(Space) == type) { values.Add(keys[i], spaces[indexes[i]]); } else if (typeof(iTween.EaseType) == type) { values.Add(keys[i], easeTypes[indexes[i]]); } else if (typeof(iTween.LoopType) == type) { values.Add(keys[i], loopTypes[indexes[i]]); } else if (typeof(GameObject) == type) { values.Add(keys[i], gameObjects[indexes[i]]); } else if (typeof(Transform) == type) { values.Add(keys[i], transforms[indexes[i]]); } else if (typeof(AudioClip) == type) { values.Add(keys[i], audioClips[indexes[i]]); } else if (typeof(AudioSource) == type) { values.Add(keys[i], audioSources[indexes[i]]); } else if (typeof(Vector3OrTransform) == type) { if ("v" == metadatas[i]) { values.Add(keys[i], vector3s[indexes[i]]); } else if ("t" == metadatas[i]) { values.Add(keys[i], transforms[indexes[i]]); } } else { if (typeof(Vector3OrTransformArray) != type) { continue; } if ("v" == metadatas[i]) { ArrayIndexes arrayIndexes = vector3Arrays[indexes[i]]; Vector3[] array = new Vector3[arrayIndexes.indexes.Length]; for (int j = 0; j < arrayIndexes.indexes.Length; j++) { array[j] = vector3s[arrayIndexes.indexes[j]]; } values.Add(keys[i], array); } else if ("t" == metadatas[i]) { ArrayIndexes arrayIndexes2 = transformArrays[indexes[i]]; Transform[] array2 = new Transform[arrayIndexes2.indexes.Length]; for (int k = 0; k < arrayIndexes2.indexes.Length; k++) { array2[k] = transforms[arrayIndexes2.indexes[k]]; } values.Add(keys[i], array2); } else if ("p" == metadatas[i]) { values.Add(keys[i], strings[indexes[i]]); } } } }
private void SerializeValues() { List <string> list = new List <string>(); List <int> list2 = new List <int>(); List <string> list3 = new List <string>(); List <int> list4 = new List <int>(); List <float> list5 = new List <float>(); List <bool> list6 = new List <bool>(); List <string> list7 = new List <string>(); List <Vector3> list8 = new List <Vector3>(); List <Color> list9 = new List <Color>(); List <Space> list10 = new List <Space>(); List <iTween.EaseType> list11 = new List <iTween.EaseType>(); List <iTween.LoopType> list12 = new List <iTween.LoopType>(); List <GameObject> list13 = new List <GameObject>(); List <Transform> list14 = new List <Transform>(); List <AudioClip> list15 = new List <AudioClip>(); List <AudioSource> list16 = new List <AudioSource>(); List <ArrayIndexes> list17 = new List <ArrayIndexes>(); List <ArrayIndexes> list18 = new List <ArrayIndexes>(); foreach (KeyValuePair <string, object> value in values) { Dictionary <string, Type> dictionary = EventParamMappings.mappings[this.type]; Type type = dictionary[value.Key]; if (typeof(int) == type) { AddToList(list, list2, list4, list3, value); } if (typeof(float) == type) { AddToList(list, list2, list5, list3, value); } else if (typeof(bool) == type) { AddToList(list, list2, list6, list3, value); } else if (typeof(string) == type) { AddToList(list, list2, list7, list3, value); } else if (typeof(Vector3) == type) { AddToList(list, list2, list8, list3, value); } else if (typeof(Color) == type) { AddToList(list, list2, list9, list3, value); } else if (typeof(Space) == type) { AddToList(list, list2, list10, list3, value); } else if (typeof(iTween.EaseType) == type) { AddToList(list, list2, list11, list3, value); } else if (typeof(iTween.LoopType) == type) { AddToList(list, list2, list12, list3, value); } else if (typeof(GameObject) == type) { AddToList(list, list2, list13, list3, value); } else if (typeof(Transform) == type) { AddToList(list, list2, list14, list3, value); } else if (typeof(AudioClip) == type) { AddToList(list, list2, list15, list3, value); } else if (typeof(AudioSource) == type) { AddToList(list, list2, list16, list3, value); } else if (typeof(Vector3OrTransform) == type) { if (value.Value == null || typeof(Transform) == value.Value.GetType()) { AddToList(list, list2, list14, list3, value.Key, value.Value, "t"); } else { AddToList(list, list2, list8, list3, value.Key, value.Value, "v"); } } else if (typeof(Vector3OrTransformArray) == type) { if (typeof(Vector3[]) == value.Value.GetType()) { Vector3[] array = (Vector3[])value.Value; ArrayIndexes arrayIndexes = new ArrayIndexes(); int[] array2 = new int[array.Length]; for (int i = 0; i < array.Length; i++) { list8.Add(array[i]); array2[i] = list8.Count - 1; } arrayIndexes.indexes = array2; AddToList(list, list2, list17, list3, value.Key, arrayIndexes, "v"); } else if (typeof(Transform[]) == value.Value.GetType()) { Transform[] array3 = (Transform[])value.Value; ArrayIndexes arrayIndexes2 = new ArrayIndexes(); int[] array4 = new int[array3.Length]; for (int j = 0; j < array3.Length; j++) { list14.Add(array3[j]); array4[j] = list14.Count - 1; } arrayIndexes2.indexes = array4; AddToList(list, list2, list18, list3, value.Key, arrayIndexes2, "t"); } else if (typeof(string) == value.Value.GetType()) { AddToList(list, list2, list7, list3, value.Key, value.Value, "p"); } } } keys = list.ToArray(); indexes = list2.ToArray(); metadatas = list3.ToArray(); ints = list4.ToArray(); floats = list5.ToArray(); bools = list6.ToArray(); strings = list7.ToArray(); vector3s = list8.ToArray(); colors = list9.ToArray(); spaces = list10.ToArray(); easeTypes = list11.ToArray(); loopTypes = list12.ToArray(); gameObjects = list13.ToArray(); transforms = list14.ToArray(); audioClips = list15.ToArray(); audioSources = list16.ToArray(); vector3Arrays = list17.ToArray(); transformArrays = list18.ToArray(); }