Operating System Simulator Plugin
3.5.1
Unreal Engine plugin that simulates an Operating System Environment
|
A class that manages the bank functionality in the operating system. More...
#include "OperatingSystemBankManager.h"
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. | |
A class that manages the bank functionality in the operating system.
UOperatingSystemBankManager::UOperatingSystemBankManager | ( | ) |
|
static |
Clears the bank singleton and saves any changes made to it.
|
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.
|
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.
Lhs | The first bank account to compare. |
Rhs | The second bank account to compare. |
|
static |
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. |
|
static |
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. |
|
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.
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. |
|
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.
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. |
|
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.
ForUser | The user for whom to retrieve the bank accounts. |
OutBankAccounts | The array where the retrieved bank accounts will be stored. |
|
static |
Checks if the given bank account is valid.
This method validates the provided bank account and returns a boolean value indicating its validity.
IsValid()
method on the provided FOperatingSystemBankAccount
struct.TestAccount | The bank account to be validated. |
true
: The bank account is valid.false
: The bank account is invalid.
|
static |
Check if a bank setting is valid.
TestBankSetting | The bank setting to be tested. |
|
static |
Check if a credit card has expired.
TestCard | The credit card to check. |
|
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.
TestCard | The credit card to be checked for validity. |
|
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.
TestTransaction | The transaction to be checked for validity. |
|
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.
User | The user for whom the bank account is registered. |
CreatedAccount | The bank account that has been created. |
|
protected |
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. |
|
protected |
Blueprint event triggered when a credit card is found in the operating system bank.
Card | The credit card found. |
|
static |
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. |
|
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.
Lhs | The first credit card to compare. |
Rhs | The second credit card to compare. |
|
static |
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 |
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 |
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 |
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 |
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 |
Checks if the specified user has any bank accounts.
TestUser | The user to check for bank accounts. |
|
static |
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. |