Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- Maps map = new Maps();
- Console.WriteLine("Высота: " + map.gameObjs.GetLength(0) + " Ширина: " + map.gameObjs.GetLength(1));
- Grafic.CanvasConsole(ref map);
- }
- class Grafic
- {
- public static void CanvasConsole(ref Maps map)
- {
- string str = "";
- int height = map.gameObjs.GetLength(0);
- int weight = map.gameObjs.GetLength(1);
- for (int i = 0; i < height; i++)
- {
- for (int j = 0; j < weight; j++)
- {
- char c = map.gameObjs[i, j].visual;
- str += c;
- }
- Console.WriteLine(str);
- str = "";
- }
- }
- }
- class Maps
- {
- public static int height = 100;
- private static int weight = 1000;
- public GameObjs[,] gameObjs;
- public Maps()
- {
- gameObjs = new GameObjs[height, weight];
- for (int i = 0; i < height; i++)
- for (int j = 0; j < weight; j++)
- {
- gameObjs[i, j] = new GameObjs();
- }
- }
- }
- class GameObjs
- {
- public char visual = '.';
- public bool destruct = false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement