Door(int x, int y, ConsoleColor fore, bool isOpened) { this.x = x; this.y = y; this.isOpened = isOpened; this.icon = CIcon.Tile(fore, ConsoleColor.Black, isOpened? openedChar : closedChar); }
public void repaint(List <Dot> updateOnly) { var p = zeroPriorities; foreach (CDrawable cd in objects) { int x = cd.X, y = cd.Y; //if (!dotNeedsUpdate(updateOnly, x, y)) // continue; if (!isIn(x, y)) { continue; } CIcon ic = cd.Icon; if (p[x][y].priority > ic.priority) { // if this is background then draw a color if (ic.isBackround && !p[x][y].isBackround) { p[x][y].back = ic.back; } // get a color of prioritet background continue; } if (p[x][y].priority == -1) { // if default p[x][y] = ic; continue; } // if there is anything behind this new symbol if (ic.isBackround && p[x][y].isBackround) { p[x][y] = ic; continue; } p[x][y].fore = ic.fore; p[x][y].c = ic.c; p[x][y].priority = ic.priority; } for (int i = 0; i < wid; ++i) { for (int j = 0; j < hei; ++j) { bool needRepaint = dotNeedsUpdate(updateOnly, i, j); Console.SetCursorPosition(0, 0); //Console.SetCursorPosition(startX + i, startY + hei + 4 + j); //Console.BackgroundColor = ConsoleColor.Black; //Console.Write(needRepaint? 'X':'.'); if (!needRepaint) { continue; } Console.SetCursorPosition(startX + i, startY + j); p[i][j].Repaint(); } } Console.ResetColor(); }
Unit(int x, int y, CIcon icon, UnitMind mind, Team team) { this.x = x; this.y = y; this.icon = icon; this.mind = mind; this.mind.host = this; this.team = team; }
static public Tile grassTile(int x, int y) { return(new Tile(x, y, CIcon.Tile(ConsoleColor.DarkGreen, ConsoleColor.Black, ','))); }
static public Tile stoneTile(int x, int y) { return(new Tile(x, y, CIcon.Tile(ConsoleColor.DarkBlue, ConsoleColor.Black, '.'))); }
Tile(int x, int y, CIcon icon) { this.x = x; this.y = y; this.icon = icon; }
static public Unit neutralGnome(int x, int y) { return(new Unit(x, y, CIcon.Character(ConsoleColor.DarkGray, 'o'), new NoMind(), Team.neutral)); }
static public Unit enemyGoblinPatrol(int x, int y, MoveDirection defaultDirection) { return(new Unit(x, y, CIcon.Character(ConsoleColor.DarkGreen, 'à'), new WalkByDirection(defaultDirection), Team.enemy)); }
static public Unit enemyGoblin(int x, int y) { return(new Unit(x, y, CIcon.Character(ConsoleColor.DarkGreen, 'a'), new NoMind(), Team.enemy)); }
static public Unit player(int x, int y) { return(new Unit(x, y, CIcon.CharacterPlayer(ConsoleColor.Red, 'ì'), new Controller(), Team.player)); }