Esempio n. 1
0
        /// <summary>
        /// Состояние карты
        /// </summary>
        /// <param name="Map">Карта</param>
        public MapState(Map Map)
            : base(Map)
        {
            if (Map == null)
            {
                throw new ArgumentOutOfRangeException("Map", "Map of MapState cannot be null");
            }

            this.Map = Map;
            try
            {
                Levels = new MapLevelState[LevelsCount];
                for (UInt16 i = 0; i < LevelsCount; i++)
                {
                    Levels[i] = new MapLevelState(Map.Levels[i], i);
                    Levels[i].WallDestroying += (sender, cell, args) => { OnWallDestroying(cell, args.Wall); };
                    Levels[i].WallDestroyed  += (sender, cell, args) => { OnWallDestroyed(cell, args.Wall); };
                }
                Areas         = new MapAreasState(Map.Areas);
                ActiveObjects = new Dictionary <Guid, MapActiveObjectState>();
            }
            catch
            {
                throw;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Состояние карты
        /// </summary>
        /// <param name="Map">Карта</param>
        public MapState(Map Map)
            : base(Map)
        {
            if (Map == null) throw new ArgumentOutOfRangeException("Map", "Map of MapState cannot be null");

            this.Map = Map;
            try
            {
                Levels = new MapLevelState[LevelsCount];
                for (UInt16 i = 0; i < LevelsCount; i++)
                {
                    Levels[i] = new MapLevelState(Map.Levels[i], i);
                    Levels[i].WallDestroying += (sender, cell, args) => { OnWallDestroying(cell, args.Wall); };
                    Levels[i].WallDestroyed += (sender, cell, args) => { OnWallDestroyed(cell, args.Wall); };
                }
                Areas = new MapAreasState(Map.Areas);
                ActiveObjects = new Dictionary<Guid, MapActiveObjectState>();
            }
            catch
            {
                throw;
            }
        }