Czoko_Smieciarka/Trunk/MonoGameView/DataModels/Models/ImageContainer.cs
2019-04-22 16:50:40 +02:00

43 lines
1.5 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"));
}
public static Texture2D GetImage(string s)
{
return _container.Images[s];
}
public ImageContainer()
{
}
}
}