diff options
Diffstat (limited to 'NW4RTools/ResFile.cs')
-rw-r--r-- | NW4RTools/ResFile.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/NW4RTools/ResFile.cs b/NW4RTools/ResFile.cs index 02919e5..4f4a1b8 100644 --- a/NW4RTools/ResFile.cs +++ b/NW4RTools/ResFile.cs @@ -2,11 +2,46 @@ using System; namespace NW4RTools { public class ResFile : ResDict<object> { + public const string ModelGroupName = "3DModels(NW4R)"; + public const string TextureGroupName = "Textures(NW4R)"; + + public UInt16 Version; + public ResDict<TValue> CreateGroup<TValue>(string name) { + if (ContainsKey(name)) { + return this[name] as ResDict<TValue>; + } else { + var newDict = new ResDict<TValue>(); + this[name] = newDict; + return newDict; + } + } + public ResDict<TValue> GetGroup<TValue>(string name) { return this[name] as ResDict<TValue>; } + + + #region Specific Group Creators + public ResDict<Models.Model> CreateModelGroup() { + return CreateGroup<Models.Model>(ModelGroupName); + } + + public ResDict<Texture> CreateTextureGroup() { + return CreateGroup<Texture>(TextureGroupName); + } + #endregion + + #region Specific Group Getters + public ResDict<Models.Model> GetModelGroup() { + return GetGroup<Models.Model>(ModelGroupName); + } + + public ResDict<Texture> GetTextureGroup() { + return GetGroup<Texture>(TextureGroupName); + } + #endregion } } |