Files
SimUL/Assets/Scripts/Actions/Eat.cs
T
2022-10-18 16:58:28 +03:00

19 lines
556 B
C#

namespace Assets.Scripts.Actions
{
public class Eat : BaseAction, ISellableItem
{
private double _price;
private int _energyPerTick;
public Eat(int duration, int energyPerTick, double price) : base(duration)
{
_price = price;
_energyPerTick = energyPerTick;
}
public override void ApplyAction(PlayerController playerController)
{
playerController.foodEnergy.increase(_energyPerTick);
playerController.money.deduct(_price);
}
}
}