Exemplo n.º 1
0
    /// <remarks>
    /// Note that if _activeRecord doesn't exist then nothing happens here.  A decorator around
    /// this instance can be used to achieve a particular behavior is that case.
    /// </remarks>
    public void progressTransaction(string actor, string action, string outcome, int?adjustment)
    {
        if (_activeRecord == null)
        {
            return;
        }

        var step = createStep(actor, action, outcome, adjustment);

        _activeRecord.addStep(step);

        onTransactionProgressed?.Invoke(this, new TransactionEventArgs(_activeRecord));
    }
Exemplo n.º 2
0
    protected virtual void generateWithdrawAction(int withdrawValue)
    {
        var transaction = new TransactionRecord("Banking", _instanceCount++);

        var step = new TransactionStep(
            "Player",
            "Withdrew funds",
            "Balance zeroed",
            -withdrawValue
            );

        transaction.addStep(step);

        _ledger.appendTransaction(transaction);
    }
Exemplo n.º 3
0
    protected virtual void generateDepositAction(int depositValue)
    {
        var transaction = new TransactionRecord("Banking", _instanceCount++);

        var step = new TransactionStep(
            "Player",
            "Deposited funds",
            "Balance updated",
            depositValue
            );

        transaction.addStep(step);

        _ledger.appendTransaction(transaction);
    }