Exemple #1
0
        private void LoadMap()
        {
            //Clear everything.
            ListBackgroundsPath = new List <string>();
            ListForegroundsPath = new List <string>();
            FileStream   FS = new FileStream("Content/Maps/Deathmatch Maps/" + BattleMapPath + ".pem", FileMode.Open, FileAccess.Read);
            BinaryReader BR = new BinaryReader(FS, Encoding.UTF8);

            BR.BaseStream.Seek(0, SeekOrigin.Begin);

            //Map parameters.
            MapName = Path.GetFileNameWithoutExtension(BattleMapPath);

            LoadProperties(BR);

            LoadSpawns(BR);

            ListMapScript = MapScript.LoadMapScripts(BR, DicMapEvent, DicMapCondition, DicMapTrigger, out ListMapEvent);

            LoadTilesets(BR);

            LoadMapGrid(BR);

            BR.Close();
            FS.Close();
        }
        public void LoadMap(bool BackgroundOnly = false)
        {
            //Clear everything.
            ListTileSet = new List <Texture2D>();
            FileStream   FS = new FileStream("Content/Maps/Sorcerer Street/" + BattleMapPath + ".pem", FileMode.Open, FileAccess.Read);
            BinaryReader BR = new BinaryReader(FS, Encoding.UTF8);

            BR.BaseStream.Seek(0, SeekOrigin.Begin);

            //Map parameters.
            MapName = Path.GetFileNameWithoutExtension(BattleMapPath);

            LoadProperties(BR);

            LoadSpawns(BR);

            ListMapScript = MapScript.LoadMapScripts(BR, DicMapEvent, DicMapCondition, DicMapTrigger, out ListMapEvent);

            LoadTilesets(BR);

            LoadMapGrid(BR);

            BR.Close();
            FS.Close();

            TogglePreview(BackgroundOnly);
        }
Exemple #3
0
        private void LoadMap(bool BackgroundOnly = false)
        {
            ListTileSet = new List <Texture2D>();
            FileStream   FS = new FileStream("Content/Maps/World Maps/" + BattleMapPath + ".pem", FileMode.Open, FileAccess.Read);
            BinaryReader BR = new BinaryReader(FS, Encoding.UTF8);

            BR.BaseStream.Seek(0, SeekOrigin.Begin);

            //Map parameters.
            MapName = Path.GetFileNameWithoutExtension(BattleMapPath);

            LoadProperties(BR);

            ListMapScript = MapScript.LoadMapScripts(BR, DicMapEvent, DicMapCondition, DicMapTrigger, out ListMapEvent);

            LoadTilesets(BR);

            LoadMapGrid(BR);

            int MapZoneCount = BR.ReadInt32();

            for (int Z = 0; Z < MapZoneCount; Z++)
            {
                MapZoneInfo ActiveZone = new MapZoneInfo();
                ListZone.Add(ActiveZone);

                ActiveZone.Name = BR.ReadString();
                ActiveZone.NumberOfUnitsRequired = BR.ReadInt32();
                byte ColorRed   = BR.ReadByte();
                byte ColorGreen = BR.ReadByte();
                byte ColorBlue  = BR.ReadByte();
                ActiveZone.Color = System.Drawing.Color.FromArgb(255, ColorRed, ColorGreen, ColorBlue);

                int ListZoneTileCount = BR.ReadInt32();
                for (int T = 0; T < ListZoneTileCount; T++)
                {
                    float PointX = BR.ReadSingle();
                    float PointY = BR.ReadSingle();
                    float PointZ = BR.ReadSingle();
                    ActiveZone.ListZoneTile.Add(new Vector3(PointX, PointY, PointZ));
                }
            }

            FS.Close();
            BR.Close();
        }