using MyCollections.Stats; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace MyCollections.Stats { public class BasicStatModifier : StatModifier { private readonly StatType type; private readonly Func<int, int> operation; //Constructor public BasicStatModifier(StatType type, float duration, Func<int, int> operation) : base(duration) { this.type = type; this.operation = operation; } public override void Handle(object sender, Query query) { //Check the stat type if (query.statType == type) { //Perform operation query.value = operation((int)query.value); } } } }