Operating System Simulator Plugin
3.5.1
Unreal Engine plugin that simulates an Operating System Environment
|
Struct representing a fund request to the bank in the operating system. More...
#include "OperatingSystemBankTypes.h"
Public Member Functions | |
FORCEINLINE bool | IsValid () const |
FORCEINLINE bool | CanApprove () const |
FOperatingSystemRequestFund () | |
FOperatingSystemRequestFund (const int32 &Amount, const FOperatingSystemRangeTime &TimeToApprove, const float &ApprovalChance, const int64 &AccountNumber) | |
Public Attributes | |
float | Amount |
FOperatingSystemRangeTime | TimeToApprove |
float | ApprovalChance |
int64 | AccountNumber |
Struct representing a fund request to the bank in the operating system.
|
inline |
Default constructor
|
inline |
Constructs an instance of a fund request, which includes information such as the amount to request, the time taken for approval, the chance of approval, and the account number associated with the request.
Example usage: FOperatingSystemRequestFund request(100, TimeToApprove, 0.7f, 123456789);
Amount | The amount to request from the bank. Must be a positive integer value. |
TimeToApprove | The time it takes for the bank to process the request. Must be a valid time range. |
ApprovalChance | A random chance of the bank approving the request, ranging from 0.0 to 1.0. |
AccountNumber | The account number associated with the fund request. Must be a valid 64-bit integer value. |
|
inline |
Checks if the bank request can be approved.
The CanApprove() method checks if the bank request can be approved. It generates a random number between 0.0 and 1.0 using the FMath::FRandRange() function, and compares it to the approval chance of the fund request. If the approval chance is greater than or equal to the random number, the method returns true indicating that the request can be approved. Otherwise, the method returns false indicating that the request cannot be approved.
|
inline |
Checks if the bank request is valid.
The IsValid() method checks if the bank request is valid based on the following conditions:
int64 FOperatingSystemRequestFund::AccountNumber |
Account number needed for fund request
This variable represents the account number associated with the fund request. It is an unsigned 64-bit integer value. The account number is used to identify the specific account for which the fund request is being made.
float FOperatingSystemRequestFund::Amount |
Amount to request from bank.
float FOperatingSystemRequestFund::ApprovalChance |
Random chance of bank approving the request where range being 0.0 - 1.0. E.g: 0.7 means 70% chance of bank approving the request.
FOperatingSystemRangeTime FOperatingSystemRequestFund::TimeToApprove |
How long does the bank take to process the request.