using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using MLEM.Font;
using MLEM.Startup;
using MLEM.Textures;

namespace TouchyTickets; 

public static class Assets {

    public static UniformTextureAtlas TilesTexture { get; private set; }
    public static UniformTextureAtlas AttractionTexture { get; private set; }
    public static UniformTextureAtlas UiTexture { get; private set; }

    public static SoundEffect ClickSound { get; private set; }
    public static SoundEffect PlaceSound { get; private set; }
    public static SoundEffect BuySound { get; private set; }

    public static Vector2 TileSize { get; private set; }
    public static GenericFont Font { get; private set; }
    public static GenericFont MonospacedFont { get; private set; }

    public static void Load() {
        Assets.TilesTexture = new UniformTextureAtlas(MlemGame.LoadContent<Texture2D>("Textures/Tiles"), 16, 16);
        Assets.AttractionTexture = new UniformTextureAtlas(MlemGame.LoadContent<Texture2D>("Textures/Attractions"), 16, 16);
        Assets.UiTexture = new UniformTextureAtlas(MlemGame.LoadContent<Texture2D>("Textures/Ui"), 16, 16);

        Assets.ClickSound = MlemGame.LoadContent<SoundEffect>("Sounds/Click");
        Assets.PlaceSound = MlemGame.LoadContent<SoundEffect>("Sounds/Place");
        Assets.BuySound = MlemGame.LoadContent<SoundEffect>("Sounds/StarBuy");

        Assets.TileSize = new Vector2(Assets.AttractionTexture.RegionWidth, Assets.AttractionTexture.RegionHeight);
        Assets.Font = new GenericSpriteFont(MlemGame.LoadContent<SpriteFont>("Fonts/" + Localization.Get("Font")));
        Assets.MonospacedFont = new GenericSpriteFont(MlemGame.LoadContent<SpriteFont>("Fonts/Monospaced"));
    }

}