2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
29 speciesName = parentPrefab.GetBaseCharacterSpeciesName(speciesName);
47 private void ParseConfigElement()
62 private readonly ContentXElement originalElement;
77 if (!
Prefabs.ContainsKey(speciesName)) {
return null; }
83 return Prefabs.Find(p => p.ContentFile.Path == filePath);
93 originalElement = mainElement;
102 string name = element.GetAttributeString(
"name",
null);
103 if (!
string.IsNullOrEmpty(name))
105 DebugConsole.NewMessage($
"Error in {file.Path}: 'name' is deprecated! Use 'speciesname' instead.", Color.Orange);
109 name = element.GetAttributeString(
"speciesname",
string.Empty);
119 DebugConsole.ThrowError($
"No species name defined for: {file.Path}",
static void RemoveByPrefab(CharacterPrefab prefab)
Contains character data that should be editable in the character editor.
static XElement CreateVariantXml(ContentXElement variantXML, ContentXElement baseXML)
static bool CheckSpeciesName(XElement mainElement, CharacterFile file, out Identifier name)
static readonly Identifier HumanGroup
static IEnumerable< ContentXElement > ConfigElements
static CharacterPrefab FindByFilePath(string filePath)
static CharacterFile HumanConfigFile
void InheritFrom(CharacterPrefab parent)
CharacterPrefab(ContentXElement mainElement, CharacterFile file)
static CharacterPrefab Find(Predicate< CharacterPrefab > predicate)
Identifier GetBaseCharacterSpeciesName(Identifier speciesName)
static CharacterPrefab FindBySpeciesName(Identifier speciesName)
CharacterInfoPrefab CharacterInfoPrefab
ContentXElement ConfigElement
static Identifier ParseName(XElement element, CharacterFile file)
CharacterPrefab ParentPrefab
static readonly PrefabCollection< CharacterPrefab > Prefabs
bool MatchesSpeciesNameOrGroup(Identifier speciesNameOrGroup)
static readonly Identifier HumanSpeciesName
readonly ContentPackage ContentPackage
ContentPackage? ContentPackage
ContentXElement? GetChildElement(string name)
bool GetAttributeBool(string key, bool def)
Identifier GetAttributeIdentifier(string key, string def)
readonly ContentFile ContentFile
readonly Identifier Identifier
Prefab that has a property serves as a deterministic hash of a prefab's identifier....