Example #1
0
        // Rebuilds the tile array. Usually called after the map's rows and columns have changed.
        public void RebuildMap()
        {
            /* Check to make sure the values for rows and columns are't negative numbers or zero.
             Set them to 1 if they are. */
            if (GetRows() <= 0)
                SetRows(1);

            if (GetColumns() <= 0)
                SetColumns(1);

            // Initialize the Tile array based on the above dimensions.
            TILES = new Tile[columns, rows];

            for (int i = 0; i < columns; i++)
                for (int j = 0; j < rows; j++)
                    TILES[i, j] = new Tile();

            FillFloor(GetDefaultImage());
        }
Example #2
0
 // Looks at the images used on the passed tile and files them into the image library if they aren't already.
 public static void FileImages(Tile tile, List<String> list)
 {
     for (int i = 0; i < tile.GetImageKeys().Length; i++)
     {
         if(!list.Contains(tile.GetImageKeys()[i]) && tile.GetImageKeys()[i] != null)
             list.Add(tile.GetImageKeys()[i]);
     }
 }