Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Map"/> class.
        /// </summary>
        /// <param name="logger">A reference to the logger to use.</param>
        /// <param name="mapLoader">The map loader to use to load this map.</param>
        public Map(ILogger <Map> logger, IMapLoader mapLoader)
        {
            logger.ThrowIfNull(nameof(logger));
            mapLoader.ThrowIfNull(nameof(mapLoader));

            this.logger = logger;
            this.loader = mapLoader;

            this.tiles        = new ConcurrentDictionary <Location, ITile>();
            this.loadedHashes = new HashSet <string>();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Map"/> class.
        /// </summary>
        /// <param name="logger">A reference to the logger to use.</param>
        /// <param name="mapLoader">The map loader to use to load this map.</param>
        /// <param name="creatureFinder">A reference to the creature finder.</param>
        public Map(ILogger logger, IMapLoader mapLoader, ICreatureFinder creatureFinder)
        {
            logger.ThrowIfNull(nameof(logger));
            mapLoader.ThrowIfNull(nameof(mapLoader));
            creatureFinder.ThrowIfNull(nameof(creatureFinder));

            this.Logger         = logger.ForContext <Map>();
            this.Loader         = mapLoader;
            this.CreatureFinder = creatureFinder;

            this.tiles = new ConcurrentDictionary <Location, ITile>();
        }