Esempio n. 1
0
        public WorldGenerator(ref TileSystem tileSystem)
        {
            this.tileSystem = tileSystem;

            Width = this.tileSystem.Width;
            Height = this.tileSystem.Height;
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the World class.
        /// </summary>
        /// <param name="graphicsDevice">The graphics device to use when initializing the <c>SpriteBatch</c>.</param>
        public World(GraphicsDevice graphicsDevice, int seed)
        {
            this.TileSystem = new TileSystem(2048, 2048, 16);
            Camera = new Camera();
            this.graphicsDevice = graphicsDevice;
            spriteBatch = new SpriteBatch(this.graphicsDevice);
            RenderTarget = new RenderTarget2D(graphicsDevice, (int)Helper.GetWindowSize().X, (int)Helper.GetWindowSize().Y);

            worldGen = new WorldGenerator(ref this.TileSystem);
            GenerateWorld(false, seed);
        }