public bool Load(ref XQFileStream file) { file.ReadByte(ref m_nModelID); UInt16 nSize = 0; file.ReadUShort(ref nSize); file.ReadString(ref m_strModelName, nSize); if (m_strModelName.Length == 1) { m_strModelName = ""; } file.ReadUShort(ref nSize); file.ReadString(ref m_strChooseMusicIcon, nSize); if (m_strChooseMusicIcon.Length == 1) { m_strChooseMusicIcon = ""; } file.ReadUShort(ref nSize); file.ReadString(ref m_strChooseMusicAtlas, nSize); if (m_strChooseMusicAtlas.Length == 1) { m_strChooseMusicAtlas = ""; } return(true); }
public bool Load(ref XQFileStream file) { file.ReadByte(ref m_nSceneID); UInt16 nSize = 0; file.ReadUShort(ref nSize); file.ReadString(ref m_strSceneName, nSize); file.ReadUShort(ref nSize); file.ReadString(ref m_strChooseMusicIcon, nSize); if (m_strChooseMusicIcon.Length == 1) { m_strChooseMusicIcon = ""; } file.ReadUShort(ref nSize); file.ReadString(ref m_strRoomSceneTexture, nSize); if (m_strRoomSceneTexture.Length == 1) { m_strRoomSceneTexture = ""; } file.ReadUShort(ref nSize); file.ReadString(ref m_strSceneStage, nSize); if (m_strSceneStage.Length == 1) { m_strSceneStage = ""; } file.ReadBool(ref m_bIsFresher); return(true); }
public bool Load(ref XQFileStream file) { file.ReadUShort(ref m_nMusicID); UInt16 nSize = 0; file.ReadUShort(ref nSize); file.ReadString(ref m_strMusicName, nSize); file.ReadUShort(ref nSize); file.ReadString(ref m_strSingerName, nSize); file.ReadUShort(ref nSize); file.ReadString(ref m_strCollectionName, nSize); file.ReadByte(ref m_nType); file.ReadUShort(ref m_nTime); file.ReadUShort(ref m_nBpm); file.ReadUShort(ref nSize); file.ReadString(ref m_strIcon, nSize); if (m_strIcon.Length == 1) { m_strIcon = ""; } file.ReadUShort(ref nSize); file.ReadString(ref m_strAtlas, nSize); if (m_strAtlas.Length == 1) { m_strAtlas = ""; } file.ReadUShort(ref nSize); file.ReadString(ref m_strMusicSource, nSize); if (m_strMusicSource.Length == 1) { m_strMusicSource = ""; } file.ReadUShort(ref nSize); file.ReadString(ref m_strIntro, nSize); if (m_strIntro.Length == 1) { m_strIntro = ""; } file.ReadBool(ref m_bIsNew); return(true); }
bool ParseFile(XQFileStream file) { if (file != null && file.IsOpen()) { UInt16 usNumber = 0; file.ReadUShort(ref usNumber); for (UInt16 i = 0; i < usNumber; i++) { CItemInfo iteminfo = new CItemInfo(); iteminfo.Load(ref file); RegistItemInfo(iteminfo); } // 额外时尚值 客户端不使用 List <PlaceFashionInfo> m_PlaceFashionList = new List <PlaceFashionInfo>(); _Load <PlaceFashionInfo>(file, m_PlaceFashionList); // 光效石属性 XQDataLoadHelper.LoadToDic <byte, uint>(ref m_dicEffectStoneInfo, file, XQDataLoadHelper.ReadByte, XQDataLoadHelper.ReadUInt, false); // skin usNumber = 0; file.ReadUShort(ref usNumber); for (UInt16 i = 0; i < usNumber; i++) { CSkinInfo skinInfo = new CSkinInfo(); skinInfo.Load(ref file); AddSkinInfo(skinInfo); } //Item animation file.ReadUShort(ref usNumber); for (UInt16 i = 0; i < usNumber; i++) { CItemAniInfo itemAniInfo = new CItemAniInfo(); itemAniInfo.Load(ref file); AddItemAniInfo(itemAniInfo); } file.Close(); s_ItemInfoMap.Sort(); s_SkinInfoMap.Sort(); s_ItemAniInfoMap.Sort(); return(true); } return(false); }
//scene public bool Load() { DestroyScene(); XQFileStream file = new XQFileStream(); if (file != null) { file.Open("Data/sceneinfo"); if (file.IsOpen()) { UInt16 usNumber = 0; file.ReadUShort(ref usNumber); for (UInt16 i = 0; i < usNumber; i++) { CSceneInfo sceneinfo = new CSceneInfo(); sceneinfo.Load(ref file); RegistSceneInfo(sceneinfo); } file.Close(); s_SceneInfoMap.Sort(); return(true); } } return(false); }
protected void _Load <T>(XQFileStream file, XQHashtable hash, Action <T, ushort> action) where T : IStaticDataBase, new() { hash.Clear(); ushort usNumber = 0; file.ReadUShort(ref usNumber); for (ushort i = 0; i < usNumber; i++) { T info = new T(); info.Load(file); if (action != null) { action(info, i); } if (!hash.ContainsKey(info.ID)) { if (info.ID != 0) { hash.Add(info.ID, info); } } else { Debug.LogError(info.GetType() + " Has SameKey : " + info.ID); } } }
public bool Load(ref XQFileStream file) { file.ReadUShort(ref m_nMusicID); file.ReadByte(ref m_nModeID); file.ReadByte(ref m_nLevel); return(m_InfoEX.Load(m_nMusicID, ref file)); }
public bool Load(ref XQFileStream file) { file.ReadUInt(ref m_nType); file.ReadByte(ref m_MoveState); UInt16 nSize = 0; file.ReadUShort(ref nSize); file.ReadString(ref m_strPlayerIdleAni, nSize); file.ReadUShort(ref nSize); file.ReadString(ref m_strPlayerMoveAni, nSize); file.ReadUShort(ref nSize); file.ReadString(ref m_strWingMoveAni, nSize); return(true); }
public List <uint> m_FashionValue = new List <uint>(); //时尚值 public bool Load(XQFileStream xFs) { m_Place = xFs.ReadUInt(); ushort valueCount = xFs.ReadUShort(); uint fashionValue = 0; for (int i = 0; i < valueCount; ++i) { fashionValue = xFs.ReadUInt(); m_FashionValue.Add(fashionValue); } return(true); }
public bool Load(ref XQFileStream file) { file.ReadUInt(ref m_nType); UInt16 nSize = 0; file.ReadUShort(ref nSize); file.ReadString(ref m_strName, nSize); file.ReadByte(ref m_nR); file.ReadByte(ref m_nG); file.ReadByte(ref m_nB); file.ReadByte(ref m_nA); return(true); }
/// <summary> /// 用于从文件中读取“键”在“值”中无引用的字典 /// </summary> /// <typeparam name="TKey">键</typeparam> /// <typeparam name="TValue">值</typeparam> /// <param name="outputDic">输出字典,可以为空</param> /// <param name="xqFile">二进制文件</param> /// <param name="keyLoader">键读取方法</param> /// <param name="valueLoader">值读取方法</param> /// <param name="needClear">true 需要清除原有Dictionary的内容</param> /// <returns>true 读取成功</returns> public static bool LoadToDic <TKey, TValue>(ref Dictionary <TKey, TValue> outputDic, XQFileStream xqFile, CallbackReturn <TKey, XQFileStream> keyLoader, CallbackReturn <TValue, XQFileStream> valueLoader, bool needClear) { bool res = false; do { if (outputDic == null) { outputDic = new Dictionary <TKey, TValue>(); } else if (needClear) { outputDic.Clear(); } if (xqFile == null || !xqFile.IsOpen()) { break; } if (keyLoader == null || valueLoader == null) { break; } TKey key = default(TKey); TValue value = default(TValue); ushort count = xqFile.ReadUShort(); for (ushort i = 0; i < count; i++) { key = keyLoader(xqFile); value = valueLoader(xqFile); if (outputDic.ContainsKey(key)) { continue; } outputDic.Add(key, value); } res = true; } while (false); return(res); }
public bool LoadStage(XQFileStream file) { DestroyStage(); if (file != null && file.IsOpen()) { UInt16 usNumber = 0; file.ReadUShort(ref usNumber); for (UInt16 i = 0; i < usNumber; i++) { CMusicStage musicstage = new CMusicStage(); musicstage.Load(ref file); RegistMusicStage(musicstage); } return(true); } return(false); }
public bool Load(XQFileStream file) { DestroyModel(); if (file != null && file.IsOpen()) { UInt16 usNumber = 0; file.ReadUShort(ref usNumber); for (UInt16 i = 0; i < usNumber; i++) { CModelInfo modelinfo = new CModelInfo(); modelinfo.Load(ref file); RegistModelInfo(modelinfo); } s_ModelInfoMap.Sort(); return(true); } return(false); }
protected void _Load <T>(XQFileStream file, List <T> list, Action <T, ushort> action) where T : IStaticDataBase, new() { list.Clear(); ushort usNumber = 0; file.ReadUShort(ref usNumber); for (ushort i = 0; i < usNumber; i++) { T info = new T(); info.Load(file); if (action != null) { action(info, i); } if (info.ID != 0) { list.Add(info); } } }
protected void _Load <TKey, TValue>(XQFileStream file, Dictionary <TKey, TValue> dic, Action <TValue, ushort> action) where TValue : IStaticDataBase <TKey>, new() { if (dic == null) { dic = new Dictionary <TKey, TValue>(); } else { dic.Clear(); } ushort usNumber = file.ReadUShort(); TValue info = default(TValue); for (ushort i = 0; i < usNumber; i++) { info = new TValue(); info.Load(file); if (action != null) { action(info, i); } if (!dic.ContainsKey(info.Key)) { if (info.IsDataValid) { dic.Add(info.Key, info); } } else { Debug.LogError(info.GetType() + " Has SameKey : " + info.Key); } } }
public bool Load(ref XQFileStream file) { file.ReadUInt(ref m_nType); UInt16 nSize = 0; file.ReadUShort(ref nSize); file.ReadString(ref m_strName, nSize); file.ReadByte(ref m_anType[0]); file.ReadByte(ref m_anType[1]); file.ReadByte(ref m_anType[2]); short lTemp = 0; file.ReadShort(ref lTemp); m_SexNeed = (Sex_Type)lTemp; file.ReadInt(ref m_nMatune); file.ReadShort(ref m_nUseTimes); file.ReadUShort(ref m_nNeedLevel); file.ReadBool(ref m_bUnique); file.ReadUShort(ref m_nMaxStackNumber); file.ReadUShort(ref m_nCoolDownTag); file.ReadInt(ref m_nCooldownTime); file.ReadUShort(ref nSize); file.ReadString(ref m_strIcon, nSize); if (m_strIcon.Length == 1) { m_strIcon = ""; } file.ReadUShort(ref nSize); file.ReadString(ref m_strAtlas, nSize); if (m_strAtlas.Length == 1) { m_strAtlas = ""; } file.ReadUShort(ref nSize); file.ReadString(ref m_strAnimation, nSize); if (m_strAnimation.Length == 1) { m_strAnimation = ""; } m_nClothEffect = file.ReadUInt(); m_ClothColor = file.ReadByte(); file.ReadBool(ref m_bIsOldEffectCloth); file.ReadUShort(ref m_nVIP); file.ReadUInt(ref m_nIntimacy); file.ReadUShort(ref nSize); file.ReadString(ref m_strIntro, nSize); if (m_strIntro.Length == 1) { m_strIntro = ""; } CheckReturn(ref m_strIntro); file.ReadBool(ref m_bIsNew); file.ReadUInt(ref m_nTriggerType); m_ClothAttr = new ClothAttributeInfo((byte)file.ReadInt(), (uint)file.ReadInt()); m_EffectLevel = file.ReadInt(); m_Fashion = file.ReadUInt(); UInt16 nGeneCount = 0; file.ReadUShort(ref nGeneCount); for (UInt16 i = 0; i < nGeneCount; i++) { GeneInfo aGene = new GeneInfo(); file.ReadUShort(ref aGene.m_nGeneID); file.ReadInt(ref aGene.m_nParam1); file.ReadInt(ref aGene.m_nParam2); file.ReadUShort(ref nSize); file.ReadString(ref aGene.m_strParam, nSize); m_aGeneMap.Add(aGene.m_nGeneID, aGene); } return(true); }