using System; namespace NW4RTools { public class ResFile : ResDict { public const string ModelGroupName = "3DModels(NW4R)"; public const string TextureGroupName = "Textures(NW4R)"; public UInt16 Version; public ResDict CreateGroup(string name) { if (ContainsKey(name)) { return this[name] as ResDict; } else { var newDict = new ResDict(); this[name] = newDict; return newDict; } } public ResDict GetGroup(string name) { return ContainsKey(name) ? (this[name] as ResDict) : null; } #region Specific Group Creators public ResDict CreateModelGroup() { return CreateGroup(ModelGroupName); } public ResDict CreateTextureGroup() { return CreateGroup(TextureGroupName); } #endregion #region Specific Group Getters public ResDict GetModelGroup() { return GetGroup(ModelGroupName); } public ResDict GetTextureGroup() { return GetGroup(TextureGroupName); } #endregion } }