Czoko_Smieciarka/Trunk/MonoGameView/DataModels/Models/ImageContainer.cs
2019-05-13 17:19:02 +02:00

46 lines
1.8 KiB
C#

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<string, Texture2D> Images;
public static void InitContainer(ContentManager content)
{
_container = new ImageContainer();
_container.Images = new Dictionary<string, Texture2D>();
_container.Images.Add("house", content.Load<Texture2D>("house"));
_container.Images.Add("road1", content.Load<Texture2D>("road1"));
_container.Images.Add("road2", content.Load<Texture2D>("road2"));
_container.Images.Add("grass", content.Load<Texture2D>("grass"));
_container.Images.Add("collector", content.Load<Texture2D>("collector"));
_container.Images.Add("Glass", content.Load<Texture2D>("glass"));
_container.Images.Add("Paper", content.Load<Texture2D>("paper"));
_container.Images.Add("PlasticMetal", content.Load<Texture2D>("plasticmetal"));
_container.Images.Add("Organic", content.Load<Texture2D>("organic"));
_container.Images.Add("GlassBar", content.Load<Texture2D>("glassBar"));
_container.Images.Add("PaperBar", content.Load<Texture2D>("paperBar"));
_container.Images.Add("PlasticMetalBar", content.Load<Texture2D>("plasticMetalBar"));
_container.Images.Add("OrganicBar", content.Load<Texture2D>("organicBar"));
}
public static Texture2D GetImage(string s)
{
return _container.Images[s];
}
public ImageContainer()
{
}
}
}