Exemplo n.º 1
0
        public bool saveSkill(string skillPath, bool xml = true)
        {
            FileStream fs = null;

            try
            {
                if (xml)
                {
                    XmlPack pack = new XmlPack();
                    pack.skill = new List <GameSkill>();
                    pack.skill.AddRange(skills.Values);
                    AraleSerizlize.saveXml(pack, skillPath);
                }
                else
                {
                    fs = new FileStream(skillPath, FileMode.Create);
                    BinaryWriter w = new BinaryWriter(fs);
                    w.Write(new byte[] { 0x73, 0x6b, 0x69, 0x6c, 0x6c });
                    w.Write(ver);
                    AraleSerizlize.write <GameSkill>(skills, w);
                    fs.Close();
                }
                return(true);
            }
            catch (System.Exception e)
            {
                Log.e(e.Message, Log.Tag.Skill, e);
                if (fs != null)
                {
                    fs.Close();
                }
                return(false);
            }
        }
Exemplo n.º 2
0
 public override void write(BinaryWriter w)
 {
     w.Write(time);
     w.Write(loopInterval);
     w.Write(loopTimes);
     w.Write(state);
     w.Write(mask);
     AraleSerizlize.write <SkillNode>(nodes, w);
 }
Exemplo n.º 3
0
 public override void write(BinaryWriter w)
 {
     w.Write(id);
     w.Write(name);
     w.Write(anim);
     w.Write(state);
     actions.Sort(delegate(SkillAction x, SkillAction y)
     {
         return(x.time.CompareTo(y.time));
     });
     AraleSerizlize.write <SkillAction>(actions, w);
 }