PlayDead.Map.Map C# (CSharp) Метод

Map() публичный Метод

public Map ( GraphicsDevice graphics, Microsoft.Xna.Framework.Graphics.Texture2D tileSheet ) : System
graphics GraphicsDevice
tileSheet Microsoft.Xna.Framework.Graphics.Texture2D
Результат System
        public Map(GraphicsDevice graphics,Texture2D tileSheet)
        {
            height = graphics.DisplayMode.Height / size;
            width = graphics.DisplayMode.Width / size;

            tileMap = new Tile[height, width]; //Initializes the new map

            for (int y = 0; y < height; y++)  //Defaults all values to -1 (saves processing time)
                for (int x = 0; x < width; x++)
                    tileMap[y, x] = null;
            for (int x = 0; x < width; x++) //Better put a floor down!
                tileMap[12, x] = new Tile(tileSheet, new Rectangle(size*1,size*0,size,size),Tile.COLLIDES_WITH_TOP);
            for (int y = 13; y < height; y++)  //Fill everything under the floor so it looks nice
                for (int x = 0; x < width; x++)
                    tileMap[y, x] = new Tile(tileSheet, new Rectangle(size * 1, size * 1, size, size), Tile.SOLID_BLOCK);
        }