Operating System Simulator Plugin  3.5.1
Unreal Engine plugin that simulates an Operating System Environment
Loading...
Searching...
No Matches
UOperatingSystemBankManager Class Reference

A class that manages the bank functionality in the operating system. More...

#include "OperatingSystemBankManager.h"

Inheritance diagram for UOperatingSystemBankManager:
[legend]
Collaboration diagram for UOperatingSystemBankManager:
[legend]

Public Member Functions

 UOperatingSystemBankManager ()
 

Static Public Member Functions

static void CreateBankSingleton ()
 Creates a singleton instance of the bank manager.
 
static void ClearBankSingleton ()
 Clears the bank singleton and saves any changes made to it.
 
static OPERATINGSYSTEMSIMULATOR_API bool GetBankAccounts (const FOperatingSystemUser &ForUser, TArray< FOperatingSystemBankAccount > &OutBankAccounts)
 
static OPERATINGSYSTEMSIMULATOR_API bool FindCreditCardByName (const FOperatingSystemUser &FromUser, const FName CardName, FOperatingSystemCreditCard &OutCard)
 
static OPERATINGSYSTEMSIMULATOR_API bool FindCreditCardByNumber (const FOperatingSystemUser &FromUser, const int64 CardNumber, FOperatingSystemCreditCard &OutCard)
 
static OPERATINGSYSTEMSIMULATOR_API bool FindUserFromAccountNumber (const int64 AccountNumber, FOperatingSystemUser &OutUser, FOperatingSystemBankAccount &OutBankAccount)
 
static OPERATINGSYSTEMSIMULATOR_API void RegisterNewBankAccount (const UObject *WorldContextObject, const FOperatingSystemUser &ForUser, const FName BankRowName, FGenericError &OutErrorIfAny)
 
static OPERATINGSYSTEMSIMULATOR_API void UnregisterBankAccount (const UObject *WorldContextObject, const FOperatingSystemUser &ForUser, const FName BankName)
 
static OPERATINGSYSTEMSIMULATOR_API void TransferFundsToAnotherAccount (FGenericError &OutErrorIfAny, const int64 FromAccountNumber, const int64 ToAccountNumber, const float Amount, const FText Remarks)
 
static OPERATINGSYSTEMSIMULATOR_API void TransferFundsToAccount (FGenericError &OutErrorIfAny, const int64 TargetAccount, const float Amount, const FText Remarks)
 
static OPERATINGSYSTEMSIMULATOR_API bool UserHasAnyBankAccount (const FOperatingSystemUser &TestUser)
 
static OPERATINGSYSTEMSIMULATOR_API bool UserHasBankAccount (const FOperatingSystemUser &TestUser, const FName BankName, FOperatingSystemBankAccount &OutBankAccount)
 
static OPERATINGSYSTEMSIMULATOR_API bool IsBankAccountValid (const FOperatingSystemBankAccount &TestAccount)
 
static OPERATINGSYSTEMSIMULATOR_API bool IsBankSettingValid (const FOperatingSystemBankSetting &TestBankSetting)
 
static OPERATINGSYSTEMSIMULATOR_API bool IsCreditCardValid (const FOperatingSystemCreditCard &TestCard)
 
static OPERATINGSYSTEMSIMULATOR_API bool IsCreditCardExpired (const FOperatingSystemCreditCard &TestCard)
 
static OPERATINGSYSTEMSIMULATOR_API bool IsTransactionValid (const FOperatingSystemUserFundTransaction &TestTransaction)
 
static OPERATINGSYSTEMSIMULATOR_API void SetTransactionDescription (UPARAM(ref) FOperatingSystemUserFundTransaction &Transaction, const FText NewDescription)
 
static bool Equal_Cards (const FOperatingSystemCreditCard &Lhs, const FOperatingSystemCreditCard &Rhs)
 
static bool NotEqual_Cards (const FOperatingSystemCreditCard &Lhs, const FOperatingSystemCreditCard &Rhs)
 
static bool Equal_BankAccount (const FOperatingSystemBankAccount &Lhs, const FOperatingSystemBankAccount &Rhs)
 
static bool NotEqual_BankAccount (const FOperatingSystemBankAccount &Lhs, const FOperatingSystemBankAccount &Rhs)
 

Protected Member Functions

void K2_OnFindCreditCard (const FOperatingSystemCreditCard &Card)
 Blueprint event triggered when a credit card is found in the operating system bank.
 
void K2_OnBankAccountRegistered (const FOperatingSystemUser &User, const FOperatingSystemBankAccount &CreatedAccount)
 Event handler called when a bank account is registered.
 
void K2_OnBankAccountUnregistered (const FOperatingSystemUser &User, const FOperatingSystemBankAccount &RemovedAccount)
 BlueprintImplementableEvent called when a bank account is unregistered.
 

Detailed Description

A class that manages the bank functionality in the operating system.

Constructor & Destructor Documentation

◆ UOperatingSystemBankManager()

UOperatingSystemBankManager::UOperatingSystemBankManager ( )

Member Function Documentation

◆ ClearBankSingleton()

void UOperatingSystemBankManager::ClearBankSingleton ( )
static

Clears the bank singleton and saves any changes made to it.

Note
This method must be called before shutting down the application to ensure that any changes made to the bank singleton are persisted.
See also
UOperatingSystemBankManager::Internal_Save()
Here is the caller graph for this function:

◆ CreateBankSingleton()

void UOperatingSystemBankManager::CreateBankSingleton ( )
static

Creates a singleton instance of the bank manager.

This method creates a singleton instance of the bank manager if it does not already exist. If a bank save game exists, it loads the saved instance of the bank manager. If the save game is corrupted, it displays an error message. If no save game exists, it creates a new instance of the bank manager.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Equal_BankAccount()

bool UOperatingSystemBankManager::Equal_BankAccount ( const FOperatingSystemBankAccount & Lhs,
const FOperatingSystemBankAccount & Rhs )
static

Determines if two bank accounts are equal.

This method compares two bank accounts and checks if they are equal by comparing their properties. The equality is determined by comparing the properties of both accounts, such as the account number, balance, and other relevant fields.

Parameters
LhsThe first bank account to compare.
RhsThe second bank account to compare.
Returns
True if the bank accounts are equal, false otherwise.

◆ Equal_Cards()

bool UOperatingSystemBankManager::Equal_Cards ( const FOperatingSystemCreditCard & Lhs,
const FOperatingSystemCreditCard & Rhs )
static

Checks if two OperatingSystemCreditCard objects are equal.

This method compares two OperatingSystemCreditCard objects and determines if they are equal.

Parameters
LhsThe first OperatingSystemCreditCard object to compare.
RhsThe second OperatingSystemCreditCard object to compare.
Returns
True if the OperatingSystemCreditCard objects are equal, false otherwise.

◆ FindCreditCardByName()

bool UOperatingSystemBankManager::FindCreditCardByName ( const FOperatingSystemUser & FromUser,
const FName CardName,
FOperatingSystemCreditCard & OutCard )
static

Finds a credit card by its name.

Parameters
FromUserThe user account from which to search for the credit card.
CardNameThe name of the credit card to find.
OutCard[out] The found credit card will be stored in this parameter, if found.
Returns
True if the credit card was found, false otherwise.

◆ FindCreditCardByNumber()

bool UOperatingSystemBankManager::FindCreditCardByNumber ( const FOperatingSystemUser & FromUser,
const int64 CardNumber,
FOperatingSystemCreditCard & OutCard )
static

Finds a credit card by its number.

This method is used to search for a credit card in the operating system bank based on its number. The method checks if the user is registered with the bank and then calls the FindCreditCardByNumber method of the user's bank set. If the card is found, it is assigned to the OutCard parameter.

Parameters
FromUserThe operating system user performing the search.
CardNumberThe number of the credit card to search for.
OutCardThe reference to the operating system credit card object where the found card will be assigned.
Returns
bool Returns true if the credit card was found, false otherwise.

◆ FindUserFromAccountNumber()

bool UOperatingSystemBankManager::FindUserFromAccountNumber ( const int64 AccountNumber,
FOperatingSystemUser & OutUser,
FOperatingSystemBankAccount & OutBankAccount )
static

FindUserFromAccountNumber - Finds a user from the given account number.

This method searches for a user with a specific account number in the operating system bank. If a user with the account number is found, the user and bank account information are returned.

Parameters
AccountNumberThe account number to search for.
OutUser[out] The found user that corresponds to the account number.
OutBankAccount[out] The bank account information associated with the account number.
Returns
True if the user with the account number is found and the user is registered, false otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBankAccounts()

bool UOperatingSystemBankManager::GetBankAccounts ( const FOperatingSystemUser & ForUser,
TArray< FOperatingSystemBankAccount > & OutBankAccounts )
static

Retrieves the bank accounts for a given user.

This method retrieves the bank accounts associated with a particular user. The user is specified by the provided ForUser parameter. The retrieved bank accounts are stored in the OutBankAccounts array parameter.

Parameters
ForUserThe user for whom to retrieve the bank accounts.
OutBankAccountsThe array where the retrieved bank accounts will be stored.
Returns
True if the bank accounts were successfully retrieved for the user, false otherwise.

◆ IsBankAccountValid()

bool UOperatingSystemBankManager::IsBankAccountValid ( const FOperatingSystemBankAccount & TestAccount)
static

Checks if the given bank account is valid.

This method validates the provided bank account and returns a boolean value indicating its validity.

Note
The validity of a bank account is determined by calling the IsValid() method on the provided FOperatingSystemBankAccount struct.
Parameters
TestAccountThe bank account to be validated.
Returns
A boolean value indicating the validity of the bank account.
  • true: The bank account is valid.
  • false: The bank account is invalid.
Here is the call graph for this function:

◆ IsBankSettingValid()

bool UOperatingSystemBankManager::IsBankSettingValid ( const FOperatingSystemBankSetting & TestBankSetting)
static

Check if a bank setting is valid.

Parameters
TestBankSettingThe bank setting to be tested.
Returns
true if the bank setting is valid, false otherwise.
Here is the call graph for this function:

◆ IsCreditCardExpired()

bool UOperatingSystemBankManager::IsCreditCardExpired ( const FOperatingSystemCreditCard & TestCard)
static

Check if a credit card has expired.

Parameters
TestCardThe credit card to check.
Returns
True if the credit card is expired; false otherwise.
Here is the call graph for this function:

◆ IsCreditCardValid()

bool UOperatingSystemBankManager::IsCreditCardValid ( const FOperatingSystemCreditCard & TestCard)
static

Checks if a credit card is valid.

This method checks the validity of a given credit card by calling the IsValid() method of the FOperatingSystemCreditCard struct.

Parameters
TestCardThe credit card to be checked for validity.
Returns
true if the credit card is valid, false otherwise.
Here is the call graph for this function:

◆ IsTransactionValid()

bool UOperatingSystemBankManager::IsTransactionValid ( const FOperatingSystemUserFundTransaction & TestTransaction)
static

Checks if a transaction is valid.

This method checks whether a given transaction is valid or not. The validity of a transaction is determined based on the properties of the 'FOperatingSystemUserFundTransaction' object passed as input.

Parameters
TestTransactionThe transaction to be checked for validity.
Returns
True if the transaction is valid, false otherwise.
Here is the call graph for this function:

◆ K2_OnBankAccountRegistered()

void UOperatingSystemBankManager::K2_OnBankAccountRegistered ( const FOperatingSystemUser & User,
const FOperatingSystemBankAccount & CreatedAccount )
protected

Event handler called when a bank account is registered.

This function is called when a bank account is registered and provides information about the user and the created account.

Parameters
UserThe user for whom the bank account is registered.
CreatedAccountThe bank account that has been created.
See also
FOperatingSystemUser
FOperatingSystemBankAccount

◆ K2_OnBankAccountUnregistered()

void UOperatingSystemBankManager::K2_OnBankAccountUnregistered ( const FOperatingSystemUser & User,
const FOperatingSystemBankAccount & RemovedAccount )
protected

BlueprintImplementableEvent called when a bank account is unregistered.

Parameters
UserThe operating system user associated with the unregistered bank account.
RemovedAccountThe bank account that was unregistered.
Remarks
This event is triggered when a bank account is unregistered in the operating system bank manager.

◆ K2_OnFindCreditCard()

void UOperatingSystemBankManager::K2_OnFindCreditCard ( const FOperatingSystemCreditCard & Card)
protected

Blueprint event triggered when a credit card is found in the operating system bank.

Note
This event must be implemented in Blueprint classes that need to respond when a credit card is found.
Parameters
CardThe credit card found.

◆ NotEqual_BankAccount()

bool UOperatingSystemBankManager::NotEqual_BankAccount ( const FOperatingSystemBankAccount & Lhs,
const FOperatingSystemBankAccount & Rhs )
static

Determines if two bank accounts are not equal.

This method compares two bank account objects and checks if they are not equal.

Parameters
LhsThe first bank account object to compare.
RhsThe second bank account object to compare.
Returns
True if the two bank accounts are not equal, false otherwise.

◆ NotEqual_Cards()

bool UOperatingSystemBankManager::NotEqual_Cards ( const FOperatingSystemCreditCard & Lhs,
const FOperatingSystemCreditCard & Rhs )
static

Determines whether two credit cards are not equal.

This method compares two FOperatingSystemCreditCard objects and returns true if they are not equal, and false otherwise.

Parameters
LhsThe first credit card to compare.
RhsThe second credit card to compare.
Returns
True if the credit cards are not equal, false otherwise.

◆ RegisterNewBankAccount()

void UOperatingSystemBankManager::RegisterNewBankAccount ( const UObject * WorldContextObject,
const FOperatingSystemUser & ForUser,
const FName BankRowName,
FGenericError & OutErrorIfAny )
static

Registers a new bank account for the specified user.

Parameters
WorldContextObjectThe world context object.
ForUserThe user for whom the bank account needs to be registered.
BankRowNameThe name of the bank in the data table.
OutErrorIfAnyThe error information if registration fails.
Here is the call graph for this function:

◆ SetTransactionDescription()

void UOperatingSystemBankManager::SetTransactionDescription ( UPARAM(ref) FOperatingSystemUserFundTransaction & Transaction,
const FText NewDescription )
static

Sets the description of a user fund transaction.

This method is used to set the description of a specific user fund transaction. The provided transaction object will be updated with the new description.

Parameters
TransactionThe user fund transaction object to update.
NewDescriptionThe new description to set for the transaction.
Note
The updated transaction object will be automatically saved.

◆ TransferFundsToAccount()

void UOperatingSystemBankManager::TransferFundsToAccount ( FGenericError & OutErrorIfAny,
const int64 TargetAccount,
const float Amount,
const FText Remarks )
static

Transfers funds to the specified account.

This method transfers funds from the current account to a specified target account.

Parameters
OutErrorIfAnyReference to a FGenericError object that will contain any error information if an error occurs.
TargetAccountThe account number of the target account.
AmountThe amount of funds to transfer.
RemarksAdditional remarks or notes for the transfer.
Here is the call graph for this function:

◆ TransferFundsToAnotherAccount()

void UOperatingSystemBankManager::TransferFundsToAnotherAccount ( FGenericError & OutErrorIfAny,
const int64 FromAccountNumber,
const int64 ToAccountNumber,
const float Amount,
const FText Remarks )
static

Transfers funds from one bank account to another.

Parameters
OutErrorIfAnyThe error if any occurred during the transfer.
FromAccountNumberThe account number from which the funds will be transferred.
ToAccountNumberThe account number to which the funds will be transferred.
AmountThe amount to transfer.
RemarksAdditional remarks for the transfer.
Here is the call graph for this function:

◆ UnregisterBankAccount()

void UOperatingSystemBankManager::UnregisterBankAccount ( const UObject * WorldContextObject,
const FOperatingSystemUser & ForUser,
const FName BankName )
static

Unregisters a bank account for a user.

This method removes the specified bank account from the user's bank account list.

Parameters
WorldContextObjectThe world context object used to access the game world.
ForUserThe user for whom the bank account is to be unregistered.
BankNameThe name of the bank account to unregister.
Here is the call graph for this function:

◆ UserHasAnyBankAccount()

bool UOperatingSystemBankManager::UserHasAnyBankAccount ( const FOperatingSystemUser & TestUser)
static

Checks if the specified user has any bank accounts.

Parameters
TestUserThe user to check for bank accounts.
Returns
True if the user has at least one bank account, false otherwise.

◆ UserHasBankAccount()

bool UOperatingSystemBankManager::UserHasBankAccount ( const FOperatingSystemUser & TestUser,
const FName BankName,
FOperatingSystemBankAccount & OutBankAccount )
static

Checks if the given user has a bank account in the specified bank.

Parameters
TestUserThe user to check for a bank account.
BankNameThe name of the bank to check in.
OutBankAccount(out) The bank account of the user, if found.
Returns
true if the user has a bank account in the specified bank, false otherwise.

The documentation for this class was generated from the following files: