Exemple #1
0
        public override XmlObject Export()
        {
            MapWaveSet data = new MapWaveSet();

            data.Id = Id;
            for (int i = 0; i < Elements.Count; i++)
            {
                data.Waves.Add(Elements[i].Export() as MapMonsterWave);
            }
            return(data);
        }
Exemple #2
0
        public override void Import(XmlObject pData, bool pBuild)
        {
            MapWaveSet data = pData as MapWaveSet;

            Id = data.Id;
            this.Build();
            this.SetName();
            if (pBuild)
            {
                for (int i = 0; i < data.Waves.Count; i++)
                {
                    GameObject go    = gameObject.AddChild();
                    LevelWave  pWave = go.AddComponent <LevelWave>();
                    pWave.Import(data.Waves[i], pBuild);
                }
            }
            mWaveSet = data;
        }
Exemple #3
0
        public override void Read(XmlNode os)
        {
            foreach (XmlNode current in XmlObject.GetChilds(os))
            {
                switch (current.Name)
                {
                case "Id":
                    this.Id = ReadInt(current);
                    break;

                case "Delay":
                    this.Delay = ReadFloat(current);
                    break;

                case "MapName":
                    this.MapName = ReadString(current);
                    break;

                case "MapPath":
                    this.MapPath = ReadString(current);
                    break;

                case "AllowRide":
                    this.AllowRide = ReadBool(current);
                    break;

                case "AllowPK":
                    this.AllowPK = ReadBool(current);
                    break;

                case "AllowTrade":
                    this.AllowTrade = ReadBool(current);
                    break;

                case "AllowFight":
                    this.AllowFight = ReadBool(current);
                    break;

                case "Ally":
                    this.Ally = new MapBorn();
                    this.Ally.Read(current);
                    break;

                case "Enemy":
                    this.Enemy = new MapBorn();
                    this.Enemy.Read(current);
                    break;

                case "Neutral":
                    this.Neutral = new MapBorn();
                    this.Neutral.Read(current);
                    break;

                case "Barriers":
                    XmlObject.GetChilds(current).ForEach(delegate(XmlNode pNode)
                    {
                        MapBarrier data = new MapBarrier();
                        data.Read(pNode);
                        this.Barriers.Add(data);
                    });
                    break;

                case "Portals":
                    XmlObject.GetChilds(current).ForEach(delegate(XmlNode pNode)
                    {
                        MapPortal data = new MapPortal();
                        data.Read(pNode);
                        this.Portals.Add(data);
                    });
                    break;

                case "Regions":
                    XmlObject.GetChilds(current).ForEach(delegate(XmlNode pNode)
                    {
                        MapRegion data = ReadDynamicObject <MapRegion>(pNode);
                        this.Regions.Add(data);
                    });
                    break;

                case "MonsterGroups":
                    XmlObject.GetChilds(current).ForEach(delegate(XmlNode pNode)
                    {
                        MapMonsterGroup data = new MapMonsterGroup();
                        data.Read(pNode);
                        this.MonsterGroups.Add(data);
                    });
                    break;

                case "MineGroups":
                    XmlObject.GetChilds(current).ForEach(delegate(XmlNode pNode)
                    {
                        MapMineGroup data = new MapMineGroup();
                        data.Read(pNode);
                        this.MineGroups.Add(data);
                    });
                    break;

                case "WaveSets":
                    XmlObject.GetChilds(current).ForEach(delegate(XmlNode pNode)
                    {
                        MapWaveSet data = new MapWaveSet();
                        data.Read(pNode);
                        this.WaveSets.Add(data);
                    });
                    break;

                case "Npcs":
                    XmlObject.GetChilds(current).ForEach(delegate(XmlNode pNode)
                    {
                        MapNpc data = new MapNpc();
                        data.Read(pNode);
                        this.Npcs.Add(data);
                    });
                    break;
                }
            }
        }