Skip to content

UOperatingSystemBankManager

#include <OperatingSystemSimulator/Public/Data/OperatingSystemBankManager.h>
class UOperatingSystemBankManager

Defined in OperatingSystemBankManager.h:181

Inherits: USaveGame

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemBankManager["UOperatingSystemBankManager"]
  class USaveGame["USaveGame"]
  USaveGame <|-- UOperatingSystemBankManager
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemBankManager["UOperatingSystemBankManager"]
  class FOperatingSystemUser["FOperatingSystemUser"]
  UOperatingSystemBankManager *-- FOperatingSystemUser
  class FOperatingSystemBankUserData["FOperatingSystemBankUserData"]
  UOperatingSystemBankManager *-- FOperatingSystemBankUserData
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemBankManager {
    +UOperatingSystemBankManager()
    +CreateBankSingleton()
    +ClearBankSingleton()
    +GetBankAccounts(const FOperatingSystemUser &ForUser, TArray bool
    +FindCreditCardByName(const FOperatingSystemUser &FromUser, const bool
    +FindCreditCardByNumber(const FOperatingSystemUser &FromUser, const bool
    +FindUserFromAccountNumber(const int64 AccountNumber, FOperatingSystem bool
    +RegisterNewBankAccount(const UObject *WorldContextObject, const FO
    +UnregisterBankAccount(const UObject *WorldContextObject, const FO
    +TransferFundsToAnotherAccount(FGenericError &OutErrorIfAny, const int64 F
    +TransferFundsToAccount(FGenericError &OutErrorIfAny, const int64 T
    +UserHasAnyBankAccount(const FOperatingSystemUser &TestUser) bool
    +UserHasBankAccount(const FOperatingSystemUser &TestUser, const bool
    +IsBankAccountValid(const FOperatingSystemBankAccount &TestAcco bool
    +IsBankSettingValid(const FOperatingSystemBankSetting &TestBank bool
    +IsCreditCardValid(const FOperatingSystemCreditCard &TestCard) bool
    +IsCreditCardExpired(const FOperatingSystemCreditCard &TestCard) bool
    +IsTransactionValid(const FOperatingSystemUserFundTransaction & bool
    +SetTransactionDescription(FOperatingSystemUserFundTransaction &Transa
    +Equal_Cards(const FOperatingSystemCreditCard &Lhs, cons bool
    +NotEqual_Cards(const FOperatingSystemCreditCard &Lhs, cons bool
    +Equal_BankAccount(const FOperatingSystemBankAccount &Lhs, con bool
    +NotEqual_BankAccount(const FOperatingSystemBankAccount &Lhs, con bool
    +K2_OnFindCreditCard(const FOperatingSystemCreditCard &Card)
    +K2_OnBankAccountRegistered(const FOperatingSystemUser &User, const FOp
    +K2_OnBankAccountUnregistered(const FOperatingSystemUser &User, const FOp
    +CardTypeDataTable : TSoftObjectPtr< UDataTable >
    +BankTypeDataTable : TSoftObjectPtr< UDataTable >
    +BankUsers : TMap< FOperatingSystemUser(), FOperating
    +Internal_Save()
  }

Documented call sites inside the plugin (6):

flowchart LR
  UOperatingSystemBankManager__Internal_Save["UOperatingSystemBankManager::Internal_Save"]
  UOperatingSystemBankManager__ClearBankSingleton["UOperatingSystemBankManager::ClearBankSingleton"]
  UOperatingSystemBankManager__ClearBankSingleton --> UOperatingSystemBankManager__Internal_Save
  UOperatingSystemBankManager__RegisterNewBankAccount["UOperatingSystemBankManager::RegisterNewBankAccount"]
  UOperatingSystemBankManager__RegisterNewBankAccount --> UOperatingSystemBankManager__Internal_Save
  UOperatingSystemBankManager__SetTransactionDescription["UOperatingSystemBankManager::SetTransactionDescription"]
  UOperatingSystemBankManager__SetTransactionDescription --> UOperatingSystemBankManager__Internal_Save
  UOperatingSystemBankManager__TransferFundsToAccount["UOperatingSystemBankManager::TransferFundsToAccount"]
  UOperatingSystemBankManager__TransferFundsToAccount --> UOperatingSystemBankManager__Internal_Save
  UOperatingSystemBankManager__TransferFundsToAnotherAccount["UOperatingSystemBankManager::TransferFundsToAnotherAccount"]
  UOperatingSystemBankManager__TransferFundsToAnotherAccount --> UOperatingSystemBankManager__Internal_Save
  UOperatingSystemBankManager__UnregisterBankAccount["UOperatingSystemBankManager::UnregisterBankAccount"]
  UOperatingSystemBankManager__UnregisterBankAccount --> UOperatingSystemBankManager__Internal_Save

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

ReturnNameDescription
UOperatingSystemBankManager

UOperatingSystemBankManager()

Defined in OperatingSystemBankManager.h:265

ReturnNameDescription
voidCreateBankSingleton staticCreates a singleton instance of the bank manager.
voidClearBankSingleton staticClears the bank singleton and saves any changes made to it.
boolGetBankAccounts staticRetrieves the bank accounts for a given user.
boolFindCreditCardByName staticFinds a credit card by its name.
boolFindCreditCardByNumber staticFinds a credit card by its number.
boolFindUserFromAccountNumber staticFindUserFromAccountNumber - Finds a user from the given account number.
voidRegisterNewBankAccount staticRegisters a new bank account for the specified user.
voidUnregisterBankAccount staticUnregisters a bank account for a user.
voidTransferFundsToAnotherAccount staticTransfers funds from one bank account to another.
voidTransferFundsToAccount staticTransfers funds to the specified account.
boolUserHasAnyBankAccount staticChecks if the specified user has any bank accounts.
boolUserHasBankAccount staticChecks if the given user has a bank account in the specified bank.
boolIsBankAccountValid staticChecks if the given bank account is valid.
boolIsBankSettingValid staticCheck if a bank setting is valid.
boolIsCreditCardValid staticChecks if a credit card is valid.
boolIsCreditCardExpired staticCheck if a credit card has expired.
boolIsTransactionValid staticChecks if a transaction is valid.
voidSetTransactionDescription staticSets the description of a user fund transaction.
boolEqual_Cards staticChecks if two OperatingSystemCreditCard objects are equal.
boolNotEqual_Cards staticDetermines whether two credit cards are not equal.
boolEqual_BankAccount staticDetermines if two bank accounts are equal.
boolNotEqual_BankAccount staticDetermines if two bank accounts are not equal.

static

static void CreateBankSingleton()

Defined in OperatingSystemBankManager.h:275 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.

  • Get
  • OS_LOG
  • OS_LOG_ERROR
  • OS_LOG_VERBOSE
  • OS_LOG_VERY_VERBOSE

static

static void ClearBankSingleton()

Defined in OperatingSystemBankManager.h:284 Clears the bank singleton and saves any changes made to it.

See also: UOperatingSystemBankManager::Internal_Save()


static

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

Defined in OperatingSystemBankManager.h:298 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.

  • ForUser The user for whom to retrieve the bank accounts.

  • OutBankAccounts The array where the retrieved bank accounts will be stored.

True if the bank accounts were successfully retrieved for the user, false otherwise.


static

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

Defined in OperatingSystemBankManager.h:310 Finds a credit card by its name.

  • FromUser The user account from which to search for the credit card.

  • CardName The name of the credit card to find.

  • OutCard [out] The found credit card will be stored in this parameter, if found.

True if the credit card was found, false otherwise.


static

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

Defined in OperatingSystemBankManager.h:326 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.

  • FromUser The operating system user performing the search.

  • CardNumber The number of the credit card to search for.

  • OutCard The reference to the operating system credit card object where the found card will be assigned.

bool Returns true if the credit card was found, false otherwise.


static

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

Defined in OperatingSystemBankManager.h:341 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.

  • AccountNumber The 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.

True if the user with the account number is found and the user is registered, false otherwise.


static

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

Defined in OperatingSystemBankManager.h:352 Registers a new bank account for the specified user.

  • WorldContextObject The world context object.

  • ForUser The user for whom the bank account needs to be registered.

  • BankRowName The name of the bank in the data table.

  • OutErrorIfAny The error information if registration fails.


static

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

Defined in OperatingSystemBankManager.h:364 Unregisters a bank account for a user.

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

  • WorldContextObject The world context object used to access the game world.

  • ForUser The user for whom the bank account is to be unregistered.

  • BankName The name of the bank account to unregister.


static

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

Defined in OperatingSystemBankManager.h:376 Transfers funds from one bank account to another.

  • OutErrorIfAny The error if any occurred during the transfer.

  • FromAccountNumber The account number from which the funds will be transferred.

  • ToAccountNumber The account number to which the funds will be transferred.

  • Amount The amount to transfer.

  • Remarks Additional remarks for the transfer.


static

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

Defined in OperatingSystemBankManager.h:391 Transfers funds to the specified account.

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

  • OutErrorIfAny Reference to a FGenericError object that will contain any error information if an error occurs.

  • TargetAccount The account number of the target account.

  • Amount The amount of funds to transfer.

  • Remarks Additional remarks or notes for the transfer.


static

static bool UserHasAnyBankAccount(const FOperatingSystemUser & TestUser)

Defined in OperatingSystemBankManager.h:400 Checks if the specified user has any bank accounts.

  • TestUser The user to check for bank accounts.

True if the user has at least one bank account, false otherwise.


static

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

Defined in OperatingSystemBankManager.h:412 Checks if the given user has a bank account in the specified bank.

  • TestUser The user to check for a bank account.

  • BankName The name of the bank to check in.

  • OutBankAccount (out) The bank account of the user, if found.

true if the user has a bank account in the specified bank, false otherwise.


static

static bool IsBankAccountValid(const FOperatingSystemBankAccount & TestAccount)

Defined in OperatingSystemBankManager.h:426 Checks if the given bank account is valid.

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

  • TestAccount The bank account to be validated.

A boolean value indicating the validity of the bank account.

  • true: The bank account is valid.

  • false: The bank account is invalid.


static

static bool IsBankSettingValid(const FOperatingSystemBankSetting & TestBankSetting)

Defined in OperatingSystemBankManager.h:435 Check if a bank setting is valid.

  • TestBankSetting The bank setting to be tested.

true if the bank setting is valid, false otherwise.


static

static bool IsCreditCardValid(const FOperatingSystemCreditCard & TestCard)

Defined in OperatingSystemBankManager.h:446 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.

  • TestCard The credit card to be checked for validity.

true if the credit card is valid, false otherwise.


static

static bool IsCreditCardExpired(const FOperatingSystemCreditCard & TestCard)

Defined in OperatingSystemBankManager.h:455 Check if a credit card has expired.

  • TestCard The credit card to check.

True if the credit card is expired; false otherwise.


static

static bool IsTransactionValid(const FOperatingSystemUserFundTransaction & TestTransaction)

Defined in OperatingSystemBankManager.h:468 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.

  • TestTransaction The transaction to be checked for validity.

True if the transaction is valid, false otherwise.


static

static void SetTransactionDescription(FOperatingSystemUserFundTransaction & Transaction, const FText NewDescription)

Defined in OperatingSystemBankManager.h:482 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.

  • Transaction The user fund transaction object to update.

  • NewDescription The new description to set for the transaction.


static

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

Defined in OperatingSystemBankManager.h:495 Checks if two OperatingSystemCreditCard objects are equal.

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

  • Lhs The first OperatingSystemCreditCard object to compare.

  • Rhs The second OperatingSystemCreditCard object to compare.

True if the OperatingSystemCreditCard objects are equal, false otherwise.


static

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

Defined in OperatingSystemBankManager.h:507 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.

  • Lhs The first credit card to compare.

  • Rhs The second credit card to compare.

True if the credit cards are not equal, false otherwise.


static

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

Defined in OperatingSystemBankManager.h:522 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.

  • Lhs The first bank account to compare.

  • Rhs The second bank account to compare.

True if the bank accounts are equal, false otherwise.


static

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

Defined in OperatingSystemBankManager.h:535 Determines if two bank accounts are not equal.

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

  • Lhs The first bank account object to compare.

  • Rhs The second bank account object to compare.

True if the two bank accounts are not equal, false otherwise.

ReturnNameDescription
voidK2_OnFindCreditCardBlueprint event triggered when a credit card is found in the operating system bank.
voidK2_OnBankAccountRegisteredEvent handler called when a bank account is registered.
voidK2_OnBankAccountUnregisteredBlueprintImplementableEvent called when a bank account is unregistered.

void K2_OnFindCreditCard(const FOperatingSystemCreditCard & Card)

Defined in OperatingSystemBankManager.h:547 Blueprint event triggered when a credit card is found in the operating system bank.

  • Card The credit card found.

void K2_OnBankAccountRegistered(const FOperatingSystemUser & User, const FOperatingSystemBankAccount & CreatedAccount)

Defined in OperatingSystemBankManager.h:561 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.

  • User The user for whom the bank account is registered.

  • CreatedAccount The bank account that has been created.

See also: FOperatingSystemUser

See also: FOperatingSystemBankAccount


void K2_OnBankAccountUnregistered(const FOperatingSystemUser & User, const FOperatingSystemBankAccount & RemovedAccount)

Defined in OperatingSystemBankManager.h:572 BlueprintImplementableEvent called when a bank account is unregistered.

  • User The operating system user associated with the unregistered bank account.

  • RemovedAccount The bank account that was unregistered.

ReturnNameDescription
TSoftObjectPtr< UDataTable >CardTypeDataTableA pointer to a UDataTable object representing the card type data in the operating system bank manager.
TSoftObjectPtr< UDataTable >BankTypeDataTableBank type data table for the operating system bank manager.
TMap< FOperatingSystemUser, FOperatingSystemBankUserData >BankUsersThis TMap variable stores bank user data for the operating system.

TSoftObjectPtr< UDataTable > CardTypeDataTable

Defined in OperatingSystemBankManager.h:212 A pointer to a UDataTable object representing the card type data in the operating system bank manager.

This variable is used to store a reference to a UDataTable object that contains the card type data for the operating system bank manager. The UDataTable class is a built-in Unreal Engine class used to store structured data in a tabular format.

The card type data includes information about the different types of cards in the operating system bank, such as their names, images, and properties. This data can be accessed and used by the operating system bank manager to perform various operations related to card management.

Example usage:

// Accessing the card type data from the CardTypeDataTable variable
UDataTable* DataTable = CardTypeDataTable.LoadSynchronous();
if (DataTable != nullptr)
{
TArray<FCardTypeInfo*> CardTypes = DataTable->GetAllRows<FCardTypeInfo>();
for (FCardTypeInfo* CardType : CardTypes)
{
// Perform operations using the card type information
FString CardName = CardType->Name;
UObject* CardImage = CardType->Image;
// ...
}
}

TSoftObjectPtr< UDataTable > BankTypeDataTable

Defined in OperatingSystemBankManager.h:243 Bank type data table for the operating system bank manager.

This variable represents the data table that stores the bank type information for the operating system bank manager.

The data table is used to retrieve bank type data such as bank names, interest rates, and other relevant information. It is defined as a TSoftObjectPtr, which is a soft reference to a UDataTable object.

To access the bank type data stored in this table, you can use the LoadSynchronous function provided by the TSoftObjectPtr class.

Example usage:

// Load the bank type data table synchronously
UDataTable* BankTypeTable = BankTypeDataTable.LoadSynchronous();
// Access the bank type data
if (BankTypeTable != nullptr)
{
// Iterate over the rows in the data table
TArray<FBankTypeData*> BankTypes = BankTypeTable->GetAllRows<FBankTypeData>();
for (const FBankTypeData* BankType : BankTypes)
{
// Process bank type data
// ...
}
}

TMap< FOperatingSystemUser, FOperatingSystemBankUserData > BankUsers

Defined in OperatingSystemBankManager.h:253 This TMap variable stores bank user data for the operating system.

It is a mapping between FOperatingSystemUser objects and FOperatingSystemBankUserData objects. The FOperatingSystemUser object represents the user information, such as username and user ID, while the FOperatingSystemBankUserData object represents the user’s bank data, such as account balance and transaction history.

ReturnNameDescription
voidInternal_Save staticSaves the bank singleton to the specified save slot.

static

static void Internal_Save()

Defined in OperatingSystemBankManager.h:585 Saves the bank singleton to the specified save slot.

This method is used to save the bank singleton to a designated save slot. It retrieves the save slot name from the operating system plugin settings. The bank singleton is saved using the UGameplayStatics::SaveGameToSlot method.

See also: UOperatingSystemPluginSettings::GetBankSaveSlotName()