using System;
using UnityEngine;

namespace Assets.Source.Core.Impacting
{
    public interface IImpactor
    {
        GameObject gameObject { get; }
    }

    public static class ImpactorExtensions
    {
        public static void DoImpact(this IImpactor impactor, IImpactable target, Func<IImpactor, Impact> impactFunc, Action callback = null)
        {
            target.TakeImpact(impactFunc(impactor), callback);
        }
    }
}