Advertisement
MrVeiran

Class Map

Jun 22nd, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.50 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace MayDayGamePlay
  8. {
  9.     class Map
  10.     {
  11.         private char[,] _map;
  12.  
  13.         public char [,]CurrentMap
  14.         {
  15.             get { return _map; }
  16.            
  17.         }
  18.         public Map(char[,]TimeMap)
  19.         {
  20.             _map = TimeMap;
  21.         }
  22.  
  23.         public void MapOverlay()
  24.         {
  25.             Console.SetCursorPosition(0, 0);
  26.             for (int i = 0; i < _map.GetLength(0); i++)
  27.             {
  28.                 Console.SetCursorPosition(Console.WindowWidth-_map.GetLength(1)-1, i);
  29.                 for (int j = 0; j < _map.GetLength(1); j++)
  30.                     {
  31.                         Console.Write(_map[i, j]);
  32.                     }
  33.                 Console.WriteLine();
  34.             }
  35.         }
  36.         public void NPSandHeroOverlay(int coorX, int coorY, char symbol)
  37.         {
  38.             Console.SetCursorPosition(0, 0);
  39.             for (int i = 0; i < _map.GetLength(0); i++)
  40.             {
  41.                 Console.SetCursorPosition(Console.WindowWidth - _map.GetLength(1) - 1, i);
  42.                 for (int j = 0; j < _map.GetLength(1); j++)
  43.                 {
  44.                     if( coorX==i&&coorY==j)
  45.                     {
  46.                         Console.Write(symbol);
  47.                         break;
  48.                     }                    
  49.                 }
  50.                 Console.WriteLine();
  51.             }
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement