Наследование: XCom.Interfaces.Base.IMapTile
Пример #1
0
        private static XCMapTile CreateBlankTile()
        {
            var mt = new XCMapTile(null, null, null, null);

            mt._blank = true;
            return(mt);
        }
Пример #2
0
		public BottomPanel()
		{
			mapTile = null;
			font = new Font("Arial", 8);
			SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.UserPaint, true);
			selected = XCMapTile.MapQuadrant.Ground;

			//tileView = TileView.Instance;

			/*
			btnCut = new Button();
			btnPaste = new Button();
			btnCopy = new Button();
			btnUp = new Button();
			btnDown = new Button();

			Assembly a = Assembly.GetExecutingAssembly();
			btnCut.Image = Bitmap.FromStream(a.GetManifestResourceStream("MapView._Embedded.cut.gif"));
			btnPaste.Image = Bitmap.FromStream(a.GetManifestResourceStream("MapView._Embedded.paste.gif"));
			btnCopy.Image = Bitmap.FromStream(a.GetManifestResourceStream("MapView._Embedded.copy.gif"));
			btnUp.Image = Bitmap.FromStream(a.GetManifestResourceStream("MapView._Embedded.up.gif"));
			btnDown.Image = Bitmap.FromStream(a.GetManifestResourceStream("MapView._Embedded.down.gif"));

			btnCut.Left = 200;
			btnCut.Anchor = AnchorStyles.Top | AnchorStyles.Left;
			btnCut.Size = new Size(25, 25);
			btnCut.Click += new EventHandler(MapViewPanel.Instance.Cut_click);

			btnCopy.Left = btnCut.Right;
			btnCopy.Anchor = btnCut.Anchor;
			btnCopy.Size = btnCut.Size;
			btnCopy.Click += new EventHandler(MapViewPanel.Instance.Copy_click);

			btnPaste.Left = btnCopy.Right;
			btnPaste.Anchor = btnCopy.Anchor;
			btnPaste.Size = btnCopy.Size;
			btnPaste.Click += new EventHandler(MapViewPanel.Instance.Paste_click);

			btnUp.Left = btnPaste.Right;
			btnUp.Anchor = btnPaste.Anchor;
			btnUp.Size = btnPaste.Size;
			btnUp.Click += new EventHandler(Down_click);

			btnDown.Left = btnUp.Right;
			btnDown.Anchor = btnUp.Anchor;
			btnDown.Size = btnUp.Size;
			btnDown.Click += new EventHandler(Up_click);*/

			Globals.LoadExtras();

			//Controls.AddRange(new Control[] { btnCut, btnCopy, btnPaste, btnUp, btnDown });
		}
Пример #3
0
		private void drawTileGray(Graphics g, XCMapTile mt,int x, int y)
		{
			if(mt.Ground != null && TopView.Instance.GroundVisible)
				g.DrawImage(mt.Ground[MapViewPanel.Current].Gray,x,y-mt.Ground.Info.TileOffset);

			if(mt.North != null && TopView.Instance.NorthVisible)
				g.DrawImage(mt.North[MapViewPanel.Current].Gray,x,y-mt.North.Info.TileOffset);

			if(mt.West != null && TopView.Instance.WestVisible)
				g.DrawImage(mt.West[MapViewPanel.Current].Gray,x,y-mt.West.Info.TileOffset);

			if(mt.Content != null && TopView.Instance.ContentVisible)
				g.DrawImage(mt.Content[MapViewPanel.Current].Gray,x,y-mt.Content.Info.TileOffset);
		}
Пример #4
0
		public override void SelectedTileChanged(IMap_Base sender, SelectedTileChangedEventArgs e)
		{
			mapTile = (XCMapTile)e.SelectedTile;
			lastLoc = e.MapLocation;
			Refresh();
		}
Пример #5
0
		public override void HeightChanged(IMap_Base sender, HeightChangedEventArgs e)
		{
			lastLoc.Height = e.NewHeight;
			mapTile = (XCMapTile)map[lastLoc.Row, lastLoc.Col];
			Refresh();
		}
Пример #6
0
		private void readMap(Stream s, List<ITile> tiles)
		{
			BufferedStream input = new BufferedStream(s);
			int rows = input.ReadByte();
			int cols = input.ReadByte();
			int height = input.ReadByte();

			mapSize = new MapSize(rows, cols, height);

			//map = new MapTile[rows,cols,height];
			mapData = new XCMapTile[rows * cols * height];

			for (int h = 0; h < height; h++)
				for (int r = 0; r < rows; r++)
					for (int c = 0; c < cols; c++)
					{
						int q1 = input.ReadByte();
						int q2 = input.ReadByte();
						int q3 = input.ReadByte();
						int q4 = input.ReadByte();

						this[r, c, h] = createTile(tiles, q1, q2, q3, q4);
					}
			input.Close();
		}