Beispiel #1
0
        public bool LoadInfos()
        {
            m_SkillAttrList.Clear();

            if (!File.Exists(m_Forder + @"\\skill.dat"))
            {
                return(false);
            }


            FileStream fs = new FileStream(m_Forder + @"\\skill.dat", FileMode.Open, FileAccess.ReadWrite);

            int           ret = 0;
            SkillAttrHead ts  = new SkillAttrHead();

            byte[] _bytData = new byte[Marshal.SizeOf(ts)];

            ret = fs.Read(_bytData, 0, _bytData.Length);
            if (ret > 0) //记录头
            {
                //m_AccAttrHead = CStructBytesFormat.BytesToStruct<AccAttrHead>(_bytData);
                m_SkillAttrHead = CStructBytesFormat.rawDeserialize <SkillAttrHead>(_bytData);
            }
            while (ret > 0)
            {
                SkillAttr ts2            = new SkillAttr();
                byte[]    bytAccAttrData = new byte[Marshal.SizeOf(ts2)];

                ret = fs.Read(bytAccAttrData, 0, bytAccAttrData.Length);
                if (ret <= 0)
                {
                    break;
                }

                ts2 = CStructBytesFormat.rawDeserialize <SkillAttr>(bytAccAttrData);

                m_SkillAttrList.Add(ts2);
            }

            fs.Close();

            return(true);
        }
Beispiel #2
0
        public bool AddPlayerSkill(SkillAttr skills)
        {
            m_SkillAttrList.Add(skills);

            return(true);
        }