Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapInitializer"/> class.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 /// <param name="mapStateObserver">The map state observer.</param>
 public MapInitializer(GameConfiguration configuration, IMapStateObserver mapStateObserver)
 {
     this.defaultDropGenerator = new DefaultDropGenerator(configuration, Rand.GetRandomizer());
     this.configuration        = configuration;
     this.ItemDropDuration     = 60;
     this.ChunkSize            = 8;
     this.mapStateObserver     = mapStateObserver;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GameMap" /> class.
        /// </summary>
        /// <param name="mapDefinition">The map definition.</param>
        /// <param name="itemDropDuration">Duration of the item drop.</param>
        /// <param name="chunkSize">Size of the chunk.</param>
        /// <param name="stateObserver">The map state observer.</param>
        public GameMap(GameMapDefinition mapDefinition, int itemDropDuration, byte chunkSize, IMapStateObserver stateObserver)
        {
            this.Definition       = mapDefinition;
            this.ItemDropDuration = itemDropDuration;
            this.stateObserver    = stateObserver;
            Log.DebugFormat("Creating GameMap {0}", this.Definition);
            this.Terrain = new GameMapTerrain(this.Definition);

            this.areaOfInterestManager = new BucketAreaOfInterestManager(chunkSize);
            this.objectIdGenerator     = new IdGenerator(ViewExtensions.ConstantPlayerId + 1, 0x7FFF);
        }