internal DebugDataItem GetDebugDataItem(string attribute) { DebugDataItem result = new DebugDataItem(FormatDebugData(Get(attribute))); string source = null; bool isInherited = false; if (m_attributes.ContainsKey(attribute)) { source = m_element.Name; } else { foreach (Element type in m_types) { if (type.Fields.Exists(attribute, true)) { source = type.Name; isInherited = true; break; } } } result.IsInherited = isInherited; result.Source = source; return(result); }
internal DebugData GetDebugData() { DebugData result = new DebugData(); foreach (string attribute in GetAttributeNames(true)) { var attributeData = Get(attribute, true); var debugDataItem = new DebugDataItem(FormatDebugData(attributeData.Value)); debugDataItem.Source = attributeData.Source; debugDataItem.IsInherited = attributeData.IsInherited; result.Data.Add(attribute, debugDataItem); } return(result); }
internal DebugData GetInheritedTypesDebugData() { DebugData result = new DebugData(); // First we want all the types we include directly foreach (Element type in m_types) { if (!result.Data.ContainsKey(type.Name)) { DebugDataItem newItem = new DebugDataItem(type.Name); newItem.Source = m_element.Name; newItem.IsDefaultType = WorldModel.DefaultTypeNames.ContainsValue(type.Name); result.Data.Add(type.Name, newItem); } else { // This element directly inherits a type which has also been included // via inheriting another type result.Data[type.Name].Source += "," + m_element.Name; } // Next we want all the types that are inherited from those, as attributes // from these will take priority over any other inherited types DebugData inheritedData = type.Fields.GetInheritedTypesDebugData(); foreach (string typeName in inheritedData.Data.Keys) { if (!result.Data.ContainsKey(typeName)) { DebugDataItem item = inheritedData.Data[typeName]; item.IsInherited = true; result.Data.Add(typeName, item); } } } return(result); }
public IEditorAttributeData GetAttributeData(string attribute) { DebugDataItem data = m_controller.WorldModel.GetDebugDataItem(m_element.Name, attribute); return(new EditorAttributeData(attribute, data.IsInherited, data.Source, data.IsDefaultType)); }