using Otter;

namespace KellysMarvelousAdventure.entities
{
    class FarmHouse : Entity
    {
        private Spritemap<string> _spriteMap;
        private PolygonCollider newCollider;

        public FarmHouse(float x, float y)
        {
            X = x; Y = y;
            //SetHitbox(180, 110, Global.Type.SOLID);
            var poly = new Polygon(10, 55, 90, 7, 190, 30, 185, 170, 10, 170);//collider shape
            newCollider = new PolygonCollider(poly, (int)Global.Type.SOLID);//setit with tags
            Collider = newCollider;          
            _spriteMap = new Spritemap<string>(Assets.FARMHOUSE, 200, 200);
            _spriteMap.Add("main", new int[] { 0 }, new float[] { 3, 3 });
            _spriteMap.Play("main");
            Graphic = _spriteMap;
            Layer = 2;
        }
        public override void Update()
        {
            base.Update();
            //if (_spriteMap.CurrentAnim == "main" && _spriteMap.CurrentFrameIndex == 2)
            //    RemoveSelf();
        }
        public override void Render()
        {
            base.Render();
            //Collider.Render();
        }
    }
}
