Ejemplo n.º 1
0
        private void DisplayMapBorders()
        {
            var mapWidth   = _configProvider.GetMapWidth();
            var mapHeight  = _configProvider.GetMapHeight();
            var leftOffset = _configProvider.GetGameLeftOffset();
            var topOffset  = _configProvider.GetGameTopOffset();

            Console.Clear();

            for (int i = 0; i <= mapWidth; i++) //drawing border horizontally
            {
                Console.SetCursorPosition(i + leftOffset, topOffset);
                Console.Write("|");
                Console.SetCursorPosition(i + leftOffset, mapHeight + topOffset);
                Console.Write("|");
            }

            for (int i = 0; i <= mapHeight; i++) //drawing border vertically
            {
                Console.SetCursorPosition(leftOffset, i + topOffset);
                Console.Write("|");
                Console.SetCursorPosition(mapWidth + leftOffset, i + topOffset);
                Console.Write("|");
            }
        }
Ejemplo n.º 2
0
 public Display(IConfigProvider configProvider)
 {
     _leftOffset                = configProvider.GetGameLeftOffset();
     _topOffset                 = configProvider.GetGameTopOffset();
     _scoreLabelTopPosition     = _topOffset - 1;
     _gameOverLabelTopPosition  = _topOffset - 2;
     _gameOverLabelLeftPosition = _leftOffset + 10;
 }