using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MonoGameView.DataModels.Models { public sealed class ImageContainer { static ImageContainer _container = null; private Dictionary Images; public static void InitContainer(ContentManager content) { _container = new ImageContainer(); _container.Images = new Dictionary(); _container.Images.Add("house", content.Load("house")); _container.Images.Add("road1", content.Load("road1")); _container.Images.Add("road2", content.Load("road2")); _container.Images.Add("grass", content.Load("grass")); _container.Images.Add("collector", content.Load("collector")); _container.Images.Add("Glass", content.Load("glass")); _container.Images.Add("Paper", content.Load("paper")); _container.Images.Add("PlasticMetal", content.Load("plasticmetal")); _container.Images.Add("Organic", content.Load("organic")); _container.Images.Add("GlassBar", content.Load("glassBar")); _container.Images.Add("PaperBar", content.Load("paperBar")); _container.Images.Add("PlasticMetalBar", content.Load("plasticMetalBar")); _container.Images.Add("OrganicBar", content.Load("organicBar")); } public static Texture2D GetImage(string s) { return _container.Images[s]; } public ImageContainer() { } } }