using System;
using ActionGame.GameResources.Manager;
using ActionGame.GameResources.Models;
using Microsoft.Xna.Framework;


namespace ActionGame.GameArtifacts.Models.Maps
{
    public class Door
    {

        public Door(DoorDefinition definition, IGameContentManager gameContentManager)
        {
            Int32 tileWidth = TileSet.DRAW_WIDTH;

            this.TransportPosition = new WorldPosition()
            {
                WorldMapKey = definition.DestinationMapKey,
                WorldCellX = definition.DestinationCellX,
                WorldCellY = definition.DestinationCellY,
                PositionX = tileWidth * definition.DestinationTileX,
                PositionY = tileWidth * (definition.DestinationTileY + 1)
            };

            Int32 doorWidth = tileWidth / 4;
            Int32 inc = (tileWidth - doorWidth) / 2;
            this.Location = new Rectangle(definition.X * tileWidth + inc, definition.Y * tileWidth + inc, doorWidth, doorWidth);

        }



        public WorldPosition TransportPosition {get; private set;}
        
        public Rectangle Location {get; private set; }
    }
}
