added tooltips

This commit is contained in:
Vladimir Koshevarov
2022-11-29 19:09:00 +02:00
parent 2167b43c29
commit 73f06d8754
33 changed files with 1264 additions and 250 deletions
+11 -5
View File
@@ -2,20 +2,26 @@
namespace Assets.Scripts.Actions
{
public class Eat : BaseAction, ISellableItem
public class Eat : IPlayerAction, Interfaces.ISellable
{
public float Price { get; private set; }
public decimal Price { get; private set; }
public string Name { get; private set; }
public string Description => $"{Name} - {Price}$";
private int _energy;
public Eat(int duration, int energy, float price) : base(duration)
public Eat(string name, int energy, decimal price)
{
Name = name;
Price = price;
_energy = energy;
}
public override void ApplyAction(PlayerManager playerController)
public void ApplyAction(PlayerManager playerController)
{
playerController.food.increase(_energy);
playerController.PlayerStats[GameManager.StatsId.Food].increase(_energy);
}
}
}
@@ -1,8 +0,0 @@
namespace Assets.Scripts.Actions.Interfaces
{
internal interface ISellableItem
{
public float Price { get; }
}
}
@@ -0,0 +1,20 @@
namespace Assets.Scripts.Actions.Interfaces
{
public enum JobId { Unemployed, HotDogs };
public interface IPlayerAction
{
public string Description { get; }
public void ApplyAction(PlayerManager player);
}
public interface ISellable
{
public decimal Price { get; }
}
public interface IWorkPlace
{
public JobId JobID { get; }
public decimal Sallary { get; }
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 11ca03325bf76704b91eb2f9b2fafec9
guid: 5b7ba6deb189bc44ca6f628a799c8667
MonoImporter:
externalObjects: {}
serializedVersion: 2
+24
View File
@@ -0,0 +1,24 @@
using Assets.Scripts.Actions.Interfaces;
namespace Assets.Scripts.Actions
{
public class JobPosition : IPlayerAction, IWorkPlace
{
public string Description => $"{_position} - {Sallary}$ per hour";
public decimal Sallary { get; private set; }
public JobId JobID { get; private set; }
private string _position;
public JobPosition(string position, decimal sallary, JobId jobId)
{
_position = position;
Sallary = sallary;
}
public void ApplyAction(PlayerManager playerController)
{
playerController.WorkPlace = this;
}
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: a40c2851bc6f1454789ac4d529a148c9
guid: 80cfc634ca94f1e4fa1726ca19eab626
MonoImporter:
externalObjects: {}
serializedVersion: 2
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 46382eb4a7b5812458ddf7287b5a65ff
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+10 -5
View File
@@ -1,15 +1,20 @@
namespace Assets.Scripts.Actions
using Assets.Scripts.Actions.Interfaces;
namespace Assets.Scripts.Actions
{
public class Relax : BaseAction
public class Relax : IPlayerAction
{
private int _energyPerTick;
public Relax(int duration, int energyPerTick) : base(duration)
public Relax(int duration, int energyPerTick)
{
_energyPerTick = energyPerTick;
}
public override void ApplyAction(PlayerManager playerController)
public string Description => throw new System.NotImplementedException();
public void ApplyAction(PlayerManager playerController)
{
playerController.energy.increase(_energyPerTick);
playerController.PlayerStats[GameManager.StatsId.Energy].increase(_energyPerTick);
}
}
}
-17
View File
@@ -1,17 +0,0 @@
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();
}
}
}