public void AddSpaceType( char glyph, bool passable = true, bool transparent = true, string description = "", int r = 128, int g = 128, int b = 128, int br = 0, int bg = 0, int bb = 0) { MapSpaceType st = new MapSpaceType(); st.glyph = glyph; st.passable = passable; st.transparent = transparent; st.description = description; st.r = r; st.g = g; st.b = b; st.br = br; st.bg = bg; st.bb = bb; this.palette.Add(st); }
public void Draw() { for (int y = 0; y <= this.y2 - this.y1; y++) { int screen_y = y + this.y1; int map_y = y + this.offset_y - 9; for (int x = 0; x <= this.x2 - this.x1; x++) { int screen_x = x + this.x1; int map_x = x + this.offset_x - 40; if ( (map_x >= 0) && (map_y >= 0) && (map_x < this.map.grid.Length) && (map_y < this.map.grid[map_x].Length) && (this.map.grid[map_x][map_y] < this.map.palette.Count)) { MapSpaceType ms = this.map.palette[this.map.grid[map_x][map_y]]; ui.DrawAt(screen_x, screen_y, ms.glyph.ToString(), ms.r, ms.g, ms.b, ms.br, ms.bg, ms.bb); } else { ui.DrawAt(screen_x, screen_y, "#", 48, 48, 48, 0, 0, 0); } } } }