예제 #1
0
        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);
                }
            }
        }
예제 #2
0
 void AddItemAniInfo(CItemAniInfo itemAniInfo)
 {
     if (itemAniInfo != null && itemAniInfo.m_nType > 0)
     {
         if (!s_ItemAniInfoMap.Contains(itemAniInfo.m_nType))
         {
             s_ItemAniInfoMap.Add(itemAniInfo.m_nType, itemAniInfo);
         }
     }
 }
예제 #3
0
 void AddSkinInfo(CSkinInfo skinInfo)
 {
     if (skinInfo != null && skinInfo.m_nType > 0)
     {
         if (!s_SkinInfoMap.Contains(skinInfo.m_nType))
         {
             s_SkinInfoMap.Add(skinInfo.m_nType, skinInfo);
         }
     }
 }
예제 #4
0
        private Dictionary <byte, uint> m_dicEffectStoneInfo = new Dictionary <byte, uint>();           // 光效石属性

        /// <summary>
        /// 初始化数值类道具虚拟数据;
        /// </summary>
        public CItemInfoManager()
        {
            for (int i = (int)ItemNumerical_Type.None; i < (int)ItemNumerical_Type.Max; i++)
            {
                ItemNumerical_Type eKey   = (ItemNumerical_Type)i;
                CItemInfo          gtItem = CreateNumericalItemInfo(eKey);
                if (gtItem != null)
                {
                    s_ItemInfoMap_Numerical.Add(eKey, gtItem);
                }
            }
        }
예제 #5
0
        void RegistItemInfo(CItemInfo iteminfo)
        {
            if (iteminfo != null && iteminfo.m_nType > 0)
            {
                if (s_ItemInfoMap.Contains(iteminfo.m_nType))
                {
                    //Debug.Log("RegistItemInfo Duplicate,nType:" + iteminfo.m_nType);
                    s_ItemInfoMap.Remove(iteminfo.m_nType);
                }

                s_ItemInfoMap.Add(iteminfo.m_nType, iteminfo);
            }
        }
예제 #6
0
 void RegistSceneInfo(CSceneInfo sceneinfo)
 {
     if (s_SceneInfoMap != null && sceneinfo != null)
     {
         if (s_SceneInfoMap.Contains(sceneinfo.m_nSceneID))
         {
             //Debug.Log("RegistSceneInfo Duplicate,nType:" + sceneinfo.m_nSceneID);
         }
         else
         {
             s_SceneInfoMap.Add(sceneinfo.m_nSceneID, sceneinfo);
         }
     }
 }
예제 #7
0
 void RegistModelInfo(CModelInfo modelinfo)
 {
     if (s_ModelInfoMap != null && modelinfo != null)
     {
         if (s_ModelInfoMap.Contains(modelinfo.m_nModelID))
         {
             //Debug.Log("RegistModelInfo Duplicate,nType:" + modelinfo.m_nModelID);
         }
         else
         {
             s_ModelInfoMap.Add(modelinfo.m_nModelID, modelinfo);
         }
     }
 }
예제 #8
0
 void RegistMusicInfo(CMusicInfo musicinfo)
 {
     if (s_MusicInfoMap != null && musicinfo != null && musicinfo.m_nMusicID > 0)
     {
         if (s_MusicInfoMap.Contains(musicinfo.m_nMusicID))
         {
             //Debug.Log("RegistMusicInfo Duplicate,nType:" + musicinfo.m_nMusicID);
         }
         else
         {
             s_MusicInfoMap.Add(musicinfo.m_nMusicID, musicinfo);
         }
     }
 }
예제 #9
0
        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);
        }