public static void Init()
 {
     InitBurntLayers();
     BitMask.Init();
     layerTypeList = new Dictionary <LayerType, Dictionary <int, GroundLayer> >();
     LoadLayer(LayerType.WATER0, false);
     LoadLayer(LayerType.WATER1, false);
     LoadLayer(LayerType.WATER2, false);
     LoadLayer(LayerType.WATER3, false);
     LoadLayer(LayerType.WATER4, false);
     LoadLayer(LayerType.WATER5, false);
     LoadLayer(LayerType.WATER6, false);
     LoadLayer(LayerType.WATER7, false);
     LoadLayer(LayerType.WATER8, false);
     LoadLayer(LayerType.WATER9, false);
     LoadLayer(LayerType.GRASS10, false);
     LoadLayer(LayerType.GRASS11, false);
     LoadLayer(LayerType.GRASS12, false);
     LoadLayer(LayerType.GRASS13, false);
     LoadLayer(LayerType.GRASS14, false);
     LoadLayer(LayerType.GRASS15, false);
     LoadLayer(LayerType.GRASS16, false);
     LoadLayer(LayerType.GRASS17, false);
     LoadLayer(LayerType.GRASS18, false);
     LoadLayer(LayerType.GRASS19, false);
     LoadLayer(LayerType.GRASS20, false);
     LoadLayer(LayerType.GRASS21, false);
     LoadLayer(LayerType.GRASS22, false);
     LoadLayer(LayerType.GRASS23, false);
     LoadLayer(LayerType.GRASS24, false);
     LoadLayer(LayerType.GRASS25, false);
     LoadLayer(LayerType.GRASS26, false);
     LoadLayer(LayerType.GRASS27, false);
     LoadLayer(LayerType.GRASS28, false);
     LoadLayer(LayerType.GRASS29, false);
     LoadLayer(LayerType.GRASS30, false);
     LoadLayer(LayerType.GRASS31, false);
     LoadLayer(LayerType.GRASS32, false);
     LoadLayer(LayerType.GRASS33, false);
     LoadLayer(LayerType.GRASS34, false);
     LoadLayer(LayerType.GRASS35, false);
     LoadLayer(LayerType.GRASS36, false);
     LoadLayer(LayerType.GRASS37, false);
     LoadLayer(LayerType.GRASS38, false);
     LoadLayer(LayerType.GRASS39, false);
     LoadLayer(LayerType.GRASS40, false);
     LoadLayer(LayerType.GRASS41, false);
     LoadLayer(LayerType.GRASS42, false);
     LoadLayer(LayerType.GRASS43, false);
     LoadLayer(LayerType.GRASS44, false);
     LoadLayer(LayerType.GRASS45, false);
     LoadLayer(LayerType.GRASS46, false);
     LoadLayer(LayerType.GRASS47, false);
     LoadLayer(LayerType.GRASS48, false);
     LoadLayer(LayerType.GRASS49, false);
     LoadLayer(LayerType.GRASS50, false);
     LoadLayer(LayerType.CITYROAD, true);
     LoadLayer(LayerType.COUNTRYROAD, true);
     LoadLayer(LayerType.DRIVEWAY, true);
     LoadLayer(LayerType.PARKING, true);
     LoadLayer(LayerType.BORDER, true);
     LoadLayer(LayerType.ROADDECALS, true);
 }
        private static void LoadLayer(LayerType layerType, bool rotateBase)
        {
            Dictionary <int, GroundLayer> myList = new Dictionary <int, GroundLayer>();

            int   textureSheetHeightIndex = (int)layerType;
            float degrees = 0;

            for (int i = 0; i < 21; i++)
            {
                Sprite      sprite = new Sprite(GetSpriteSheetRectangle(i, textureSheetHeightIndex), TextureSheet.Ground);
                GroundLayer layer  = new GroundLayer(layerType, sprite, textureSheetHeightIndex, BitMask.GetBitmaskFromTileIndex(i));
                sprite.rotation = MathHelper.ToRadians(degrees);
                myList.Add(i, layer);

                if (rotateBase || i > 11)
                {
                    degrees += 90;
                }

                if (degrees == 360)
                {
                    degrees = 0;
                }
            }
            layerTypeList.Add(layerType, myList);
        }