Code/Examples/MockEconomy.cs
// =============================================================
// EXAMPLE FILE — reference implementation for integrators.
//
// This file is NOT used by the library at runtime.
// Copy it into your own RP project and adapt to your needs.
// =============================================================

using Sandbox;
using Casino.RpSlot.Economy;

namespace Casino.RpSlot.Examples;

public sealed class MockEconomy : Component, IRpEconomy
{
    [Property] public int Balance { get; set; } = 1000;

    public bool TryDebit( int amount )
    {
        if ( amount <= 0 ) return false;
        if ( Balance < amount ) return false;
        Balance -= amount;
        return true;
    }

    public void Credit( int amount )
    {
        if ( amount <= 0 ) return;
        Balance += amount;
    }
}