Implement basic structure for combat system and refactor code
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
namespace KernelPanic.Meta
|
||||
{
|
||||
/// <summary>
|
||||
/// Tracks the player's persistent entropy currency balance.
|
||||
/// </summary>
|
||||
public sealed class EntropyWallet
|
||||
{
|
||||
public int Balance { get; private set; }
|
||||
|
||||
public void Add(int amount)
|
||||
{
|
||||
Balance += amount;
|
||||
}
|
||||
|
||||
public bool Spend(int amount)
|
||||
{
|
||||
if (Balance < amount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Balance -= amount;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user