26 lines
1.1 KiB
C#
26 lines
1.1 KiB
C#
namespace NeonSprawl.Server.Game.Gathering;
|
|
|
|
/// <summary>Persisted remaining gathers per world resource-node instance (NEO-61).</summary>
|
|
public interface IResourceNodeInstanceStore
|
|
{
|
|
/// <summary>Reads the current snapshot when a row exists for <paramref name="interactableId"/>.</summary>
|
|
bool TryGetRemainingGathers(string interactableId, out ResourceNodeInstanceSnapshot snapshot);
|
|
|
|
/// <summary>
|
|
/// Creates a row at <paramref name="initialRemainingGathers"/> when absent; no-op when a row already exists.
|
|
/// </summary>
|
|
bool TryEnsureInitialized(string interactableId, int initialRemainingGathers);
|
|
|
|
/// <summary>
|
|
/// Atomically decrements when <c>remaining > 0</c>. Returns <c>false</c> when the row is missing or already
|
|
/// depleted.
|
|
/// </summary>
|
|
bool TryDecrementRemainingGathers(
|
|
string interactableId,
|
|
out int previousRemaining,
|
|
out int remainingGathers);
|
|
|
|
/// <summary>Sets remaining gathers (upsert). Used by dev Bruno fixture reset.</summary>
|
|
bool TrySetRemainingGathers(string interactableId, int remainingGathers);
|
|
}
|