private CGearBackground(int[] Palette, Tile[] tilelist, TileMap tm)
 {
     Map          = tm;
     ColorPalette = Palette;
     Tiles        = tilelist;
 }
        private static void GetTileList(IReadOnlyList <Tile> tiles, out List <Tile> tilelist, out TileMap tm)
        {
            tilelist = new List <Tile> {
                tiles[0]
            };
            tm = new TileMap(new byte[2 * Width * Height / 64]);

            // start at 1 as the 0th tile is always non-duplicate
            for (int i = 1; i < tm.TileChoices.Length; i++)
            {
                FindPossibleRotatedTile(tiles[i], tilelist, tm, i);
            }
        }