using Framework.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
using Framework.Extensions;
using Framework.StatSystem;

namespace Assets.Framework.Classes.Experiments
{
    // HACK: Temp
    public class ApplyStatEffect : CoreAction
    {
        private StatEffect statEffect;

        public ApplyStatEffect(CoreBehaviour sender, StatEffect statEffect)
            : base(sender)
        {
            this.statEffect = statEffect;
        }

        public StatEffect GetStatEffect()
        {
            return this.statEffect;
        }
    }

    public class SendModifier : CoreAction
    {
        private StatType.Id statId;
        private Modifierlike modifier;

        public SendModifier(CoreBehaviour sender, StatType.Id statId, Modifierlike modifier)
            : base(sender)
        {
            this.statId = statId;
            this.modifier = modifier;
        }

        public StatType.Id GetStatId()
        {
            return this.statId;
        }

        public Modifierlike GetModifier()
        {
            return this.modifier;
        }
    }

    public class ExperimentalConsumable : CoreBehaviour
    {
        public bool type; 

        protected void OnTriggerEnter(Collider collider)
        {
            collider.gameObject.RequestExpose(this);
            bool received = false; 
            if (type)
            {
                received = ExposedInteract(new ApplyStatEffect(this, new StatEffect(StatType.WalkSpeed, new ScaleModifier(2f), 3f)));
            }
            else
            {
                received = ExposedInteract(new ApplyStatEffect(this, new StatEffect(StatType.MaxJumpCount, new ShiftModifier(1f), 5f)));
            }
            if (received)
            {
                Destroy(this.gameObject);
            }
        }

        protected new void Log(string message)
        {
            Debug.Log(message);
        }
    }
}
