using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SFML.Graphics;
using SFML.Window;
using YourBeatingHeart.Main.Helper;

namespace YourBeatingHeart.Main.States.Play.Entities
{
    public enum RemainType
    {
        Skull,
        Arm
    }

    public class Remains : AnimatedItem
    {
        public static readonly Dictionary<RemainType, string> AnimNames = new Dictionary<RemainType, string>()
        {
            {RemainType.Skull, "skull"},
            {RemainType.Arm, "ork_arm"}
        };

        public RemainType RemainType;

        public Remains(PlayState playState, Vector2f position, String animXML, RemainType _type, float width, float height)
            : base(playState, position, animXML, width, height, ItemType.Remains)
        {
            RemainType = _type;
            Sprite.Origin = new Vector2f(64, 125);
            Sprite.Play(AnimNames[_type]);
        }

        public override void OnPlayerCollision(Player player)
        {
            if ((Velocity.LengthSqrt() > 1000) && (player != owner) && (owner != null))
            {
                player.Stun(Constants.STUN_DURATION);
                BounceH();
            }
        }

        public override void Throw(Vector2f dir)
        {
            dir.Y *= 0.25f;
            base.Throw(dir);
        }

    }
}
