Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. Maps map = new Maps();
  6. Console.WriteLine("Высота: " + map.gameObjs.GetLength(0) + " Ширина: " + map.gameObjs.GetLength(1));
  7. Grafic.CanvasConsole(ref map);
  8. }
  9.  
  10. class Grafic
  11. {
  12. public static void CanvasConsole(ref Maps map)
  13. {
  14. string str = "";
  15. int height = map.gameObjs.GetLength(0);
  16. int weight = map.gameObjs.GetLength(1);
  17. for (int i = 0; i < height; i++)
  18. {
  19. for (int j = 0; j < weight; j++)
  20. {
  21. char c = map.gameObjs[i, j].visual;
  22. str += c;
  23.  
  24. }
  25.  
  26. Console.WriteLine(str);
  27. str = "";
  28. }
  29. }
  30. }
  31.  
  32. class Maps
  33. {
  34. public static int height = 100;
  35. private static int weight = 1000;
  36.  
  37. public GameObjs[,] gameObjs;
  38.  
  39. public Maps()
  40. {
  41. gameObjs = new GameObjs[height, weight];
  42. for (int i = 0; i < height; i++)
  43. for (int j = 0; j < weight; j++)
  44. {
  45. gameObjs[i, j] = new GameObjs();
  46. }
  47. }
  48. }
  49.  
  50. class GameObjs
  51. {
  52. public char visual = '.';
  53. public bool destruct = false;
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement