added Game UI Controller
Show money on UI, buy items
This commit is contained in:
@@ -2,14 +2,17 @@
|
||||
{
|
||||
public class Eat : BaseAction
|
||||
{
|
||||
private int energyPerTick;
|
||||
public Eat(int duration, int energyPerTick, double cost) : base(duration)
|
||||
private double _price;
|
||||
private int _energyPerTick;
|
||||
public Eat(int duration, int energyPerTick, double price) : base(duration)
|
||||
{
|
||||
this.energyPerTick = energyPerTick;
|
||||
_price = price;
|
||||
_energyPerTick = energyPerTick;
|
||||
}
|
||||
public override void ApplyAction(PlayerController playerController)
|
||||
{
|
||||
playerController.foodEnergy.increase(energyPerTick);
|
||||
playerController.foodEnergy.increase(_energyPerTick);
|
||||
playerController.money.deduct(_price);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user