#region ================== Namespaces using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Text; #endregion namespace CodeImp.DoomBuilder.Map { /// /// List of universal fields and their values. /// public class UniFields : SortedList { // Owner of this list protected MapElement owner; public MapElement Owner { get { return owner; } internal set { owner = value; } } // New constructor /// public UniFields() : base(2) { } // New constructor /// public UniFields(int capacity) : base(capacity) { } // Copy constructor (makes a deep copy) /// public UniFields(UniFields copyfrom) : base(copyfrom.Count) { foreach(KeyValuePair v in copyfrom) this.Add(v.Key, new UniValue(v.Value)); } // New constructor /// public UniFields(MapElement owner) : base(2) { this.owner = owner; } // New constructor /// public UniFields(MapElement owner, int capacity) : base(capacity) { this.owner = owner; } // Copy constructor /// public UniFields(MapElement owner, UniFields copyfrom) : base(copyfrom) { this.owner = owner; } /// Call this before making changes to the fields, or they may not be updated correctly with undo/redo! public void BeforeFieldsChange() { if(owner != null) owner.BeforeFieldsChange(); } } }