/// ------------------------------------------------------------------------------------ /// <summary> /// Adds a property. /// </summary> /// ------------------------------------------------------------------------------------ internal static bool AddProp(string lang, string type, string value, List <TMXProp> propList) { var prop = new TMXProp(); prop.Lang = lang; prop.Type = type; prop.Value = value; return(AddProp(prop, propList)); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Adds a property. /// </summary> /// ------------------------------------------------------------------------------------ internal static bool AddProp(TMXProp prop, List <TMXProp> propList) { if (prop == null || prop.IsEmpty || propList == null) { return(false); } //review: I (jh) was surprised to see that each setting of a property merely added it to this list, so we'd get dozens of the same thing over and over. //From what I can tell looking around, it seems it is safe to treat these properties as atomic, so I've added this Remove before re-adding with the //current value. propList.RemoveAll(p => p.Type == prop.Type); propList.Add(prop); return(true); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Adds a property. /// </summary> /// ------------------------------------------------------------------------------------ public bool AddProp(TMXProp prop) { return(TMXProp.AddProp(prop, _props)); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Adds a property. /// </summary> /// ------------------------------------------------------------------------------------ public bool AddProp(string lang, string type, string value) { return(TMXProp.AddProp(lang, type, value, _props)); }