public void ShouldParseANamespacedScriptName() { var identifier = ObjectIdentifier.Parse("NamespaceA:NamespaceB:ScriptName"); Assert.AreEqual(identifier.NamespaceParts.Length, 2); Assert.AreEqual(identifier.NamespaceParts[0], "NamespaceA"); Assert.AreEqual(identifier.NamespaceParts[1], "NamespaceB"); Assert.AreEqual(identifier.ScriptName, "ScriptName"); }
public void ShouldParseAndConvertToAFilePath() { var identifierA = ObjectIdentifier.Parse("NamespaceA:NamespaceB:ScriptName"); var identifierB = ObjectIdentifier.FromScriptFilePath("NamespaceA/NamespaceB/ScriptName.psc"); var path = identifierB.ToScriptFilePath(); var identifierC = ObjectIdentifier.FromScriptFilePath(path); Assert.AreEqual(identifierA, identifierB); Assert.AreEqual(identifierB, identifierC); }
public void ShouldBeEquatableWithCaseInsensitivity() { var identifierA = ObjectIdentifier.Parse("NamespaceA:NamespaceB:ScriptName#StructName"); var identifierB = ObjectIdentifier.Parse("namespacea:namespaceb:scriptname#structname"); Assert.IsTrue(identifierA == identifierB); Assert.AreEqual(identifierA, identifierB); var identifierC = ObjectIdentifier.Parse("NamespaceA:NamespaceB:ScriptName"); Assert.IsTrue(identifierB != identifierC); Assert.AreNotEqual(identifierB, identifierC); }
public ComplexType GetTypeForObjectId(ObjectIdentifier objectIdentifier) { var scriptIdentifier = ObjectIdentifier.Parse(objectIdentifier.FullScriptName); _program.ScriptFiles.TryGetValue(scriptIdentifier, out var scriptFile); var scriptType = scriptFile?.Type; if (scriptType == null) { return(null); } #if FALLOUT4 if (!string.IsNullOrEmpty(objectIdentifier.StructName)) { scriptType.StructTypes.TryGetValue(objectIdentifier, out var structType); return(structType); } #endif return(scriptType); }
public void ShouldParseANamespacedScriptWithMemberName() { var identifier = ObjectIdentifier.Parse("NamespaceA:NamespaceB:ScriptName#StructName"); Assert.AreEqual(identifier.StructName, "StructName"); }
public void ShouldParseANonNamespacedScriptName() { var identifier = ObjectIdentifier.Parse("ScriptName"); Assert.AreEqual(identifier.ScriptName, "ScriptName"); }
public ScriptSymbol(ScriptNode node) : base(node, node.Header.Identifier, null, ObjectIdentifier.Parse(node.Header.Identifier.Text)) { }
public StructSymbol(StructDefinitionNode node, PapyrusSymbol parent) : base(node, node.Header.Identifier, parent, ObjectIdentifier.Parse(parent.Name + "#" + node.Header.Identifier.Text)) { }