Beispiel #1
0
        /// ------------------------------------------------------------------------------------
        /// <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));
        }
Beispiel #2
0
        /// ------------------------------------------------------------------------------------
        /// <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);
        }
Beispiel #3
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Adds a property.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public bool AddProp(TMXProp prop)
 {
     return(TMXProp.AddProp(prop, _props));
 }
Beispiel #4
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Adds a property.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public bool AddProp(string lang, string type, string value)
 {
     return(TMXProp.AddProp(lang, type, value, _props));
 }