Exemplo n.º 1
0
        public void callAutoDraw(Player watcher)
        {
            if (!_doNotCleanLine)
            {
                _global.clearLine(_source.context.players.IndexOf(_source.host), _position.Y);
            }

            _global.setPosition(_position);
            if (_isSelected)
            {
                _global.swapColor(ConsoleColor.Black);
            }
            string shortName = _source.Show(watcher);

            if (shortName == Card.InvisibleCardString)
            {
                Console.Write(shortName);
                return;
            }
            // color a rarity only in case of card has been revealed
            _global.swapFontColor(_rarityColor);
            if (_isUnit)
            {
                int firstSpace = shortName.IndexOf(' ');
                Console.Write("[");
                _global.swapFontColor(UtilsDrawing.colorsOfPower(_source as Unit));
                Console.Write(shortName.Substring(1, firstSpace - 1));
                _global.popColor();
                Console.Write(shortName.Substring(firstSpace));
            }
            else
            {
                Console.Write(shortName);
            }

            _global.popColor();
            if (_isSelected)
            {
                _global.popColor();
            }
        }