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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b77d0de67282ca4181a7c53feec4343
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
|
||||
namespace KernelPanic.Meta
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides the contract for spending entropy on persistent unlock pulls.
|
||||
/// </summary>
|
||||
public sealed class GachaService
|
||||
{
|
||||
public GachaPullResult PerformPull(EntropyWallet wallet, int cost)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents the result of a persistent unlock pull.
|
||||
/// </summary>
|
||||
public readonly struct GachaPullResult
|
||||
{
|
||||
public GachaPullResult(bool success, string unlockId)
|
||||
{
|
||||
Success = success;
|
||||
UnlockId = unlockId;
|
||||
}
|
||||
|
||||
public bool Success { get; }
|
||||
public string UnlockId { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f62e697e985a8a44ca26ccb8e853ee66
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace KernelPanic.Meta
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides save and load contracts for persistent meta progression.
|
||||
/// </summary>
|
||||
public sealed class SaveService
|
||||
{
|
||||
public void Save(SaveData data)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public SaveData Load()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stores persistent progression data for serialization.
|
||||
/// </summary>
|
||||
public sealed class SaveData
|
||||
{
|
||||
public int EntropyBalance { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 752a83f338afd024b8e728a1921e38ee
|
||||
Reference in New Issue
Block a user