public TdlNamespace AddNamespace(string identifier) { string[] namespaces = identifier.Split('.'); TdlNamespace current = this; foreach (string namespaceIdentifier in namespaces) { if (current.NamespaceLookup.ContainsKey(namespaceIdentifier)) { current = current.NamespaceLookup[namespaceIdentifier]; } else { TdlNamespace tdlNamespace = new TdlNamespace(namespaceIdentifier, current); current._Namespaces.Add(tdlNamespace); current.NamespaceLookup.Add(namespaceIdentifier, tdlNamespace); current = tdlNamespace; } } if (current.Identifier == namespaces.Last()) { return(current); } return(null); }
public TdlObject(string identifier, TdlNamespace parent) { Namespace = parent; Identifier = identifier; ObjectId = CRC.CalculateCRC32(FullName); _RequiredNamespaces = new List <string>(); _Fields = new List <TdlField>(); File.AddStringToHash(FullName); }
public bool HasNamespace(string identifier, int index = 0) { string[] namespaces = identifier.Split('.'); TdlNamespace current = this; foreach (string namespaceIdentifier in namespaces) { if (current.NamespaceLookup.ContainsKey(namespaceIdentifier)) { current = current.NamespaceLookup[namespaceIdentifier]; } else { return(false); } } return(current.Identifier == namespaces.Last()); }
public TdlNamespace(string identifier, TdlNamespace parent = null) { Identifier = identifier; Parent = parent; _Namespaces = new List <TdlNamespace>(); NamespaceLookup = new Dictionary <string, TdlNamespace>(); _Structs = new List <TdlStruct>(); StructIdentifierLookup = new Dictionary <string, TdlStruct>(); StructLookup = new Dictionary <uint, TdlStruct>(); _Classes = new List <TdlClass>(); ClassIdentifierLookup = new Dictionary <string, TdlClass>(); ClassLookup = new Dictionary <uint, TdlClass>(); _Services = new List <TdlService>(); ServiceIdentifierLookup = new Dictionary <string, TdlService>(); ServiceLookup = new Dictionary <uint, TdlService>(); }
public TdlNamespace GetNamespace(string identifier) { string[] namespaces = identifier.Split('.'); TdlNamespace current = this; foreach (string namespaceIdentifier in namespaces) { if (current.NamespaceLookup.ContainsKey(namespaceIdentifier)) { current = current.NamespaceLookup[namespaceIdentifier]; } else { break; } } if (current.Identifier == namespaces.Last()) { return(current); } return(null); }
public TdlClass(string identifier, TdlNamespace parent) : base(identifier, parent) { _Methods = new List <TdlMethod>(); MethodLookup = new Dictionary <uint, TdlMethod>(); MethodIdentifierLookup = new Dictionary <string, TdlMethod>(); }
public TdlStruct(string identifier, TdlNamespace parent) : base(identifier, parent) { _Properties = new List <TdlProperty>(); PropertyLookup = new Dictionary <uint, TdlProperty>(); PropertyIdentifierLookup = new Dictionary <string, TdlProperty>(); }