public MapLayer(DeathmatchMap Map, List <AnimationBackground> ListBackgrounds, List <AnimationBackground> ListForegrounds, BinaryReader BR)
        {
            this.Map = Map;

            ListSubLayer = new List <SubMapLayer>();

            StartupDelay   = BR.ReadInt32();
            ToggleDelayOn  = BR.ReadInt32();
            ToggleDelayOff = BR.ReadInt32();
            _Depth         = BR.ReadSingle();

            if (StartupDelay == 0)
            {
                IsVisible   = true;
                ToggleTimer = ToggleDelayOn;
            }
            else
            {
                IsVisible   = false;
                ToggleTimer = StartupDelay;
            }

            ArrayTerrain = new Terrain[Map.MapSize.X, Map.MapSize.Y];
            for (int Y = 0; Y < Map.MapSize.Y; Y++)
            {
                for (int X = 0; X < Map.MapSize.X; X++)
                {
                    ArrayTerrain[X, Y] = new Terrain(BR, X, Y);
                }
            }

            LayerGrid = OriginalLayerGrid = new DeathmatchMap2D(Map, ListBackgrounds, ListForegrounds, BR);
            OriginalLayerGrid.Depth = Depth;
        }
Example #2
0
        public MapLayer(DeathmatchMap Map)
        {
            this.Map = Map;

            ListSingleplayerSpawns = new List <EventPoint>();
            ListMultiplayerSpawns  = new List <EventPoint>();
            ListMapSwitchPoint     = new List <MapSwitchPoint>();
            ListTeleportPoint      = new List <TeleportPoint>();

            ListSubLayer = new List <SubMapLayer>();
            ListProp     = new List <InteractiveProp>();
            IsVisible    = true;

            //Tiles
            ArrayTerrain = new Terrain[Map.MapSize.X, Map.MapSize.Y];
            for (int Y = 0; Y < Map.MapSize.Y; Y++)
            {
                for (int X = 0; X < Map.MapSize.X; X++)
                {
                    ArrayTerrain[X, Y] = new Terrain(X, Y);
                }
            }

            LayerGrid = new DeathmatchMap2D(Map, this);
            _Depth    = LayerGrid.Depth;
        }
        public MapLayer(DeathmatchMap Map, List <AnimationBackground> ListBackgrounds, List <AnimationBackground> ListForegrounds)
        {
            this.Map = Map;

            ListSubLayer = new List <SubMapLayer>();
            IsVisible    = true;

            //Tiles
            ArrayTerrain = new Terrain[Map.MapSize.X, Map.MapSize.Y];
            for (int Y = 0; Y < Map.MapSize.Y; Y++)
            {
                for (int X = 0; X < Map.MapSize.X; X++)
                {
                    ArrayTerrain[X, Y] = new Terrain(X, Y);
                }
            }

            LayerGrid = OriginalLayerGrid = new DeathmatchMap2D(Map, ListBackgrounds, ListForegrounds);
            _Depth    = OriginalLayerGrid.Depth;
        }
Example #4
0
        public MapLayer(DeathmatchMap Map, BinaryReader BR)
        {
            this.Map = Map;

            ListSingleplayerSpawns = new List <EventPoint>();
            ListMultiplayerSpawns  = new List <EventPoint>();
            ListMapSwitchPoint     = new List <MapSwitchPoint>();
            ListTeleportPoint      = new List <TeleportPoint>();

            ListSubLayer = new List <SubMapLayer>();
            ListProp     = new List <InteractiveProp>();

            StartupDelay   = BR.ReadInt32();
            ToggleDelayOn  = BR.ReadInt32();
            ToggleDelayOff = BR.ReadInt32();
            _Depth         = BR.ReadSingle();

            if (StartupDelay == 0)
            {
                IsVisible   = true;
                ToggleTimer = ToggleDelayOn;
            }
            else
            {
                IsVisible   = false;
                ToggleTimer = StartupDelay;
            }

            ArrayTerrain = new Terrain[Map.MapSize.X, Map.MapSize.Y];
            for (int Y = 0; Y < Map.MapSize.Y; Y++)
            {
                for (int X = 0; X < Map.MapSize.X; X++)
                {
                    ArrayTerrain[X, Y] = new Terrain(BR, X, Y);
                }
            }

            int ListSingleplayerSpawnsCount = BR.ReadInt32();

            ListSingleplayerSpawns = new List <EventPoint>(ListSingleplayerSpawnsCount);

            for (int S = 0; S < ListSingleplayerSpawnsCount; S++)
            {
                EventPoint NewPoint = new EventPoint(BR);
                NewPoint.ColorRed   = Color.Blue.R;
                NewPoint.ColorGreen = Color.Blue.G;
                NewPoint.ColorBlue  = Color.Blue.B;

                ListSingleplayerSpawns.Add(NewPoint);
            }

            int ListMultiplayerSpawnsCount = BR.ReadInt32();

            ListMultiplayerSpawns = new List <EventPoint>(ListMultiplayerSpawnsCount);

            for (int S = 0; S < ListMultiplayerSpawnsCount; S++)
            {
                EventPoint NewPoint   = new EventPoint(BR);
                int        ColorIndex = Convert.ToInt32(NewPoint.Tag) - 1;

                /*NewPoint.ColorRed = Map.ListMultiplayerColor[ColorIndex].R;
                 * NewPoint.ColorGreen = Map.ListMultiplayerColor[ColorIndex].G;
                 * NewPoint.ColorBlue = Map.ListMultiplayerColor[ColorIndex].B;*/
                ListMultiplayerSpawns.Add(NewPoint);
            }

            int ListMapSwitchPointCount = BR.ReadInt32();

            ListMapSwitchPoint = new List <MapSwitchPoint>(ListMapSwitchPointCount);

            for (int S = 0; S < ListMapSwitchPointCount; S++)
            {
                MapSwitchPoint NewMapSwitchPoint = new MapSwitchPoint(BR);
                ListMapSwitchPoint.Add(NewMapSwitchPoint);
                if (BattleMap.DicBattmeMapType.Count > 0 && !string.IsNullOrEmpty(NewMapSwitchPoint.SwitchMapPath) &&
                    Map.ListSubMap.Find(x => x.BattleMapPath == NewMapSwitchPoint.SwitchMapPath) == null)
                {
                    BattleMap NewMap = BattleMap.DicBattmeMapType[NewMapSwitchPoint.SwitchMapType].GetNewMap(string.Empty);
                    NewMap.BattleMapPath  = NewMapSwitchPoint.SwitchMapPath;
                    NewMap.ListGameScreen = Map.ListGameScreen;
                    NewMap.ListSubMap     = Map.ListSubMap;
                    NewMap.Load();
                }
            }

            int ListTeleportPointCount = BR.ReadInt32();

            ListTeleportPoint = new List <TeleportPoint>(ListTeleportPointCount);

            for (int S = 0; S < ListTeleportPointCount; S++)
            {
                TeleportPoint NewTeleportPoint = new TeleportPoint(BR);
                ListTeleportPoint.Add(NewTeleportPoint);
            }

            int ListPropCount = BR.ReadInt32();

            ListProp = new List <InteractiveProp>(ListPropCount);
            for (int L = 0; L < ListPropCount; L++)
            {
                ListProp.Add(Map.DicInteractiveProp[BR.ReadString()].LoadCopy(BR));
            }

            LayerGrid = new DeathmatchMap2D(Map, this, BR);
            int ListSubLayerCount = BR.ReadInt32();

            ListSubLayer = new List <SubMapLayer>(ListSubLayerCount);
            for (int L = 0; L < ListSubLayerCount; L++)
            {
                ListSubLayer.Add(new SubMapLayer(Map, BR));
            }

            LayerGrid.Depth = Depth;
        }