Fix shop System
add food indicator
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
namespace Assets.Scripts.Actions
|
||||
{
|
||||
public abstract class BaseAction
|
||||
{
|
||||
protected int DurationInTicks { get; }
|
||||
protected int ElapsedTicks { get; }
|
||||
|
||||
protected BaseAction(int durationTicks)
|
||||
{
|
||||
DurationInTicks = durationTicks;
|
||||
}
|
||||
|
||||
public abstract void ApplyAction(PlayerController playerController);
|
||||
|
||||
}
|
||||
namespace Assets.Scripts.Actions
|
||||
{
|
||||
public abstract class BaseAction
|
||||
{
|
||||
protected int DurationInTicks { get; }
|
||||
protected int ElapsedTicks { get; }
|
||||
|
||||
protected BaseAction(int durationTicks)
|
||||
{
|
||||
DurationInTicks = durationTicks;
|
||||
}
|
||||
|
||||
public abstract void ApplyAction(PlayerManager playerController);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -5,17 +5,17 @@ namespace Assets.Scripts.Actions
|
||||
public class Eat : BaseAction, ISellableItem
|
||||
{
|
||||
public float Price { get; private set; }
|
||||
private int _energyPerTick;
|
||||
public Eat(int duration, int energyPerTick, float price) : base(duration)
|
||||
private int _energy;
|
||||
public Eat(int duration, int energy, float price) : base(duration)
|
||||
{
|
||||
Price = price;
|
||||
_energyPerTick = energyPerTick;
|
||||
_energy = energy;
|
||||
}
|
||||
|
||||
|
||||
public override void ApplyAction(PlayerController playerController)
|
||||
public override void ApplyAction(PlayerManager playerController)
|
||||
{
|
||||
playerController.foodEnergy.increase(_energyPerTick);
|
||||
playerController.food.increase(_energy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{
|
||||
_energyPerTick = energyPerTick;
|
||||
}
|
||||
public override void ApplyAction(PlayerController playerController)
|
||||
public override void ApplyAction(PlayerManager playerController)
|
||||
{
|
||||
playerController.energy.increase(_energyPerTick);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
namespace Assets.Scripts.Actions
|
||||
{
|
||||
public class Work : BaseAction
|
||||
{
|
||||
private PlayerController playerController;
|
||||
private int energyPerTick;
|
||||
public Work(PlayerController player, int duration, int energyPerTick) : base(duration)
|
||||
{
|
||||
this.playerController = player;
|
||||
this.energyPerTick = energyPerTick;
|
||||
}
|
||||
public override void ApplyAction(PlayerController playerController)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace Assets.Scripts.Actions
|
||||
{
|
||||
public class Work : BaseAction
|
||||
{
|
||||
private PlayerManager playerController;
|
||||
private int energyPerTick;
|
||||
public Work(PlayerManager player, int duration, int energyPerTick) : base(duration)
|
||||
{
|
||||
this.playerController = player;
|
||||
this.energyPerTick = energyPerTick;
|
||||
}
|
||||
public override void ApplyAction(PlayerManager playerController)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user