Czoko_Smieciarka/Trunk/MonoGameView/DataModels/Models/ImageContainer.cs
2019-04-22 14:55:47 +02:00

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