protected override void RenderCell(IMapTile tile, System.Drawing.Graphics g, int x, int y) { XCMapTile mapTile = (XCMapTile)tile; if (!blank) { if (mapTile.Ground != null && this.g.Checked) g.FillPath(Brushes["GroundColor"], UpperPath(x,y)); if (mapTile.North != null && n.Checked) g.DrawLine(Pens["NorthColor"], x, y, x + hWidth, y + hHeight); if (mapTile.West != null && w.Checked) g.DrawLine(Pens["WestColor"], x, y, x - hWidth, y + hHeight); if (mapTile.Content != null && c.Checked) g.FillPath(Brushes["ContentColor"], LowerPath(x,y)); } else { if (!mapTile.DrawAbove) { g.FillPath(System.Drawing.Brushes.DarkGray, UpperPath(x, y)); g.FillPath(System.Drawing.Brushes.DarkGray, LowerPath(x, y)); } } }
public SelectedTileChangedEventArgs(MapLocation newSelected, IMapTile selectedTile) { this.newSelected = newSelected; this.selectedTile = selectedTile; }
protected virtual void RenderCell(IMapTile tile, System.Drawing.Graphics g, int x, int y) { }
public void ResizeTo(int r, int c, int h) { //MapTile[, ,] newMap = new MapTile[r, c, h]; IMapTile[] newMap = new IMapTile[r * c * h]; //newMap[(mapSize.Rows * mapSize.Cols * height) + (row * mapSize.Cols) + col] for (int hc = 0; hc < h; hc++) for (int rc = 0; rc < r; rc++) for (int cc = 0; cc < c; cc++) newMap[(r * c * hc) + (rc * c) + cc] = XCMapTile.BlankTile; //newMap[rc, cc, hc] = MapTile.BlankTile; for (int hc = 0; hc < h && hc < mapSize.Height; hc++) for (int rc = 0; rc < r && rc < mapSize.Rows; rc++) for (int cc = 0; cc < c && cc < mapSize.Cols; cc++) newMap[(r * c * (h - hc - 1)) + (rc * c) + cc] = this[rc, cc, mapSize.Height - hc - 1]; //newMap[rc, cc, h - hc - 1] = this[rc, cc, mapSize.Height - hc - 1]; mapData = newMap; mapSize = new MapSize(r, c, h); currentHeight = (byte)(mapSize.Height - 1); }