Example #1
0
        public GDESetListData ShallowClone()
        {
            string         newKey   = Guid.NewGuid().ToString();
            GDESetListData newClone = new GDESetListData(newKey);

            newClone.bool_list_field = new List <bool>(bool_list_field);
            newClone.Set_bool_list_field();
            newClone.int_list_field = new List <int>(int_list_field);
            newClone.Set_int_list_field();
            newClone.float_list_field = new List <float>(float_list_field);
            newClone.Set_float_list_field();
            newClone.string_list_field = new List <string>(string_list_field);
            newClone.Set_string_list_field();
            newClone.vector2_list_field = new List <Vector2>(vector2_list_field);
            newClone.Set_vector2_list_field();
            newClone.vector3_list_field = new List <Vector3>(vector3_list_field);
            newClone.Set_vector3_list_field();
            newClone.vector4_list_field = new List <Vector4>(vector4_list_field);
            newClone.Set_vector4_list_field();
            newClone.color_list_field = new List <Color>(color_list_field);
            newClone.Set_color_list_field();

            newClone.custom_list_field = new List <GDESetCustomData>(custom_list_field);
            newClone.Set_custom_list_field();

            return(newClone);
        }
Example #2
0
        public GDESetListData DeepClone()
        {
            GDESetListData newClone = ShallowClone();

            newClone.custom_list_field = new List <GDESetCustomData>();
            if (custom_list_field != null)
            {
                foreach (var val in custom_list_field)
                {
                    newClone.custom_list_field.Add(val.DeepClone());
                }
            }
            newClone.Set_custom_list_field();
            return(newClone);
        }