public void ReadCache(BinaryReader rd) { // Determine cache type rd.BaseStream.Seek(0, SeekOrigin.Begin); var magicBuf = rd.ReadBytes(4); Array.Reverse(magicBuf); string magic = Encoding.ASCII.GetString(magicBuf); // Populate cache of proper type switch (magic) { case "WMOB": CreatureCacheReader = new CacheReader <CreatureCache>(rd); break; case "WGOB": GameObjectCacheReader = new CacheReader <GameObjectCache>(rd); break; case "WQST": QuestCacheReader = new CacheReader <QuestCache>(rd); break; default: return; } }
public MultiCacheReader() { CreatureCacheReader = null; GameObjectCacheReader = null; QuestCacheReader = null; }