using System.Collections.Generic; using Microsoft.Xna.Framework.Graphics; namespace SpacePew { public static class TextureManager { private static MainGame _game; static readonly Dictionary Textures = new Dictionary(); public static void Initialize(MainGame game) { _game = game; } public static Texture2D LoadTexture(string assetName) { if (!Textures.ContainsKey(assetName)) { var texture = _game.Content.Load(assetName); Textures.Add(assetName, texture); } return Textures[assetName]; } } }