Czoko_Smieciarka/Trunk/MonoGameView/DataModels/Models/ImageContainer.cs

43 lines
1.5 KiB
C#
Raw Normal View History

2019-04-22 14:55:47 +02:00
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"));
2019-04-22 16:50:40 +02:00
_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"));
2019-04-22 14:55:47 +02:00
}
public static Texture2D GetImage(string s)
{
return _container.Images[s];
}
public ImageContainer()
{
}
}
}