using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Slayter
{
    public class MapObject:Background
    {
        
        protected Map map;
        public MapObject(Texture2D picture, Rectangle rect, Map map)
            : base(picture, rect)
        {
            this.map = map;
        }

        public override void draw(SpriteBatch spriteBatch)
        {
            Rectangle rect2 = new Rectangle(rect.X,rect.Y,rect.Width,rect.Height);
            Rectangle frame = new Rectangle(0,0,picture.Width,picture.Height);
            if (map.getPosition(ref rect2, ref frame))
            {
                spriteBatch.Draw(picture, rect2, frame, Color.White);
            }
        }
    }
}
