start to change action system
This commit is contained in:
@@ -10,6 +10,7 @@ namespace Assets.Scripts.Actions
|
||||
DurationInTicks = durationTicks;
|
||||
}
|
||||
|
||||
public abstract void ConsumeTick();
|
||||
public abstract void ApplyAction(PlayerController playerController);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,12 @@
|
||||
{
|
||||
public class Eat : BaseAction
|
||||
{
|
||||
private PlayerController playerController;
|
||||
private int energyPerTick;
|
||||
public Eat(PlayerController player, int duration, int energyPerTick, double cost) : base(duration)
|
||||
public Eat(int duration, int energyPerTick, double cost) : base(duration)
|
||||
{
|
||||
this.playerController = player;
|
||||
this.energyPerTick = energyPerTick;
|
||||
}
|
||||
public override void ConsumeTick()
|
||||
public override void ApplyAction(PlayerController playerController)
|
||||
{
|
||||
playerController.foodEnergy.increase(energyPerTick);
|
||||
}
|
||||
|
||||
@@ -2,16 +2,14 @@
|
||||
{
|
||||
public class Relax : BaseAction
|
||||
{
|
||||
private PlayerController _playerController;
|
||||
private int _energyPerTick;
|
||||
public Relax(PlayerController player, int duration, int energyPerTick) : base(duration)
|
||||
public Relax(int duration, int energyPerTick) : base(duration)
|
||||
{
|
||||
_playerController = player;
|
||||
_energyPerTick = energyPerTick;
|
||||
}
|
||||
public override void ConsumeTick()
|
||||
public override void ApplyAction(PlayerController playerController)
|
||||
{
|
||||
_playerController.restEnergy.increase(_energyPerTick);
|
||||
playerController.restEnergy.increase(_energyPerTick);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
this.playerController = player;
|
||||
this.energyPerTick = energyPerTick;
|
||||
}
|
||||
public override void ConsumeTick()
|
||||
public override void ApplyAction(PlayerController playerController)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user