public void AddTag(string name, string type, uint id, Tag tag) { TagIndexInstance instance = new TagIndexInstance(); instance.ID = id;//(uint)((tags.Count * 0x10001) + 0xe1740000); instance.Type = type; instance.Name = name; instance.Tag = tag; tags.Add(instance); }
public int GetDependencyTag(string tagName, string fourcc, ILibrary library, string alias, bool explicitBsp) { if (fourcc == "sbsp" && !explicitBsp) { for (int x = 0; x < structureBsps.Count; x++) { if (Convert.ToString(structureBsps[x]) == tagName) { return(-1); } } structureBsps.Add(tagName); return(-1); } for (int x = 0; x < tags.Count; x++) { TagIndexInstance cTag = tags[x] as TagIndexInstance; if (cTag.Name == tagName && cTag.Type == fourcc) { return(x); } } string extension = structs[fourcc].Extension; if (!library.FileExists(tagName + '.' + extension)) { foreach (string checkTag in missingTags) { if (checkTag == tagName + '.' + extension) { return(-1); } } missingTags.Add(tagName + '.' + extension); return(-1); } int curCount = tags.Count; TagIndexInstance instance = new TagIndexInstance(); instance.ID = (uint)((curCount * 0x10001) + 0xe1740000 + 0x10000 * GetMeterCount()); instance.Type = fourcc; instance.Name = alias; tags.Add(instance); instance.Tag = new Tag(tagName + '.' + extension, library, this); return(curCount); }
public int IndexByName(string name, string type) { for (int x = 0; x < tags.Count; x++) { TagIndexInstance test = tags[x] as TagIndexInstance; if (test.Name == name) { if (test.Type == type) { return(x); } } } return(-1); }
public int GetDependencyTag(string name, string type, string directory, string alias, bool explicitBsp) { if (type == "sbsp" && !explicitBsp) { for (int x = 0; x < structureBsps.Count; x++) { if (Convert.ToString(structureBsps[x]) == name) { return(-1); } } structureBsps.Add(name); return(-1); } for (int x = 0; x < tags.Count; x++) { TagIndexInstance cTag = tags[x] as TagIndexInstance; if (cTag.Name == name && cTag.Type == type) { return(x); } } if (!File.Exists(directory + '\\' + name + '.' + structs[type].Extension)) { foreach (string checkTag in missingTags) { if (checkTag == name + '.' + structs[type].Extension) { return(-1); } } missingTags.Add(name + '.' + structs[type].Extension); //throw new IOException("Need to get the following tag: " + name + '.' + structs[oType].Extension); return(-1); } int curCount = tags.Count; TagIndexInstance instance = new TagIndexInstance(); instance.ID = (uint)((curCount * 0x10001) + 0xe1740000 + 0x10000 * GetMeterCount()); instance.Type = type; instance.Name = alias; tags.Add(instance); instance.Tag = new Tag(directory + '\\' + name + '.' + structs[type].Extension, directory, this); return(curCount); }