private void UnloadEditor() { this.gui = (Gui)null; this.map = (EditMap)null; this.cameraMap = (CameraMap)null; this.pauseScreen = (Pause)null; }
protected override void LoadContent() { this.spriteBatch = new SpriteBatch(this.GraphicsDevice); switch (this.gameStateIntent) { case GameState.Menu: this.menu = new Menu(); this.menu.Instil(this.Content, this.GraphicsDevice); this.menu.start.click += new Button.ClickHandler(this.SwitchToGame); this.menu.editor.click += new Button.ClickHandler(this.SwitchToEditor); break; case GameState.InGame: this.camera = new Camera(this.GraphicsDevice.Viewport); this.player = new Player(); this.lord = new AIOverLord(); this.LoadMap(this.mapPath); this.map1.Instil(this, this.Content); this.player.Instil(this.Content, this.map1); this.camera.Instil(new Vector2(this.player.Location.X - (float)(this.GraphicsDevice.Viewport.Width / 2), this.player.Location.Y)); this.lord.Instil(this.map1, this.Content, this.player); this.gameGui = new GameGUI(this.Content, this.player, this.map1); this.dask_Backgourd = this.Content.Load <Texture2D>("Graphics\\Dask_Backgourd"); this.Cloud1 = new Scroll(new Texture2D[3] { this.Content.Load <Texture2D>("Graphics\\Cloud\\Cloud_Layer1_001"), this.Content.Load <Texture2D>("Graphics\\Cloud\\Cloud_Layer1_002"), this.Content.Load <Texture2D>("Graphics\\Cloud\\Cloud_Layer1_003") }, 4f, this.map1.xMax, this.GraphicsDevice.Viewport.Width); this.Cloud2 = new Scroll(new Texture2D[3] { this.Content.Load <Texture2D>("Graphics\\Cloud\\Cloud_Layer2_001"), this.Content.Load <Texture2D>("Graphics\\Cloud\\Cloud_Layer2_002"), this.Content.Load <Texture2D>("Graphics\\Cloud\\Cloud_Layer2_003") }, 3f, this.map1.xMax, this.GraphicsDevice.Viewport.Width); this.pauseScreen = new Pause(this.Content, this.GraphicsDevice, this.GraphicsDevice.Viewport); this.pauseScreen.menu.click += new Button.ClickHandler(this.SwitchToMenuGame); this.pauseScreen.resume.click += new Button.ClickHandler(this.ResumeGame); break; case GameState.Editor: this.GraphicsDevice.Viewport = new Viewport(0, 0, this.graphics.PreferredBackBufferWidth, this.graphics.PreferredBackBufferHeight); this.cameraMap = new CameraMap(this.GraphicsDevice.Viewport, this.currentM); this.gui = new Gui(); this.map = new EditMap(this, this.Content, this.cameraMap); this.gui.Instil(this.Content, this.GraphicsDevice, this.map, this); this.pauseScreen = new Pause(this.Content, this.GraphicsDevice, this.GraphicsDevice.Viewport); this.pauseScreen.menu.click += new Button.ClickHandler(this.SwitchToMenuEditor); this.pauseScreen.resume.click += new Button.ClickHandler(this.ResumeEditor); break; } }
public EditMap(Game1 game, ContentManager content, CameraMap camera) { this.game = game; this.camera = camera; this.tileFactory = new TileFactory(content); this.decorationFactory = new DecorationFactory(content); this.pickupFactory = new PickupFactory(content); this.tiles = new List <List <Tile> >(300); for (int index1 = 0; index1 <= 10; ++index1) { this.tiles.Add(new List <Tile>(300)); for (int index2 = 0; index2 <= 10; ++index2) { this.tiles.ElementAt <List <Tile> >(index1).Add(this.tileFactory.GetTile(TileType.Empty, (float)index2, (float)index1, false, false, false, false)); } } this.GetEdge(); }