FOperatingSystemRequestFund
#include <OperatingSystemSimulator/Public/Data/OperatingSystemBankTypes.h>Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class FOperatingSystemRequestFund["FOperatingSystemRequestFund"]
class FOperatingSystemRangeTime["FOperatingSystemRangeTime"]
FOperatingSystemRequestFund *-- FOperatingSystemRangeTime
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class FOperatingSystemRequestFund {
+Amount : float
+TimeToApprove : FOperatingSystemRangeTime()
+ApprovalChance : float
+AccountNumber : int64
+IsValid() const bool
+CanApprove() const bool
+FOperatingSystemRequestFund()
+FOperatingSystemRequestFund(const int32 &Amount, const FOperatingSystem
}
struct FOperatingSystemRequestFundDefined in OperatingSystemBankTypes.h:27 Struct representing a fund request to the bank in the operating system.
Public Attributes
Section titled “Public Attributes”| Return | Name | Description |
|---|---|---|
float | Amount | Amount to request from bank. |
FOperatingSystemRangeTime | TimeToApprove | How long does the bank take to process the request. |
float | 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. |
int64 | AccountNumber | Account number needed for fund request |
Amount
Section titled “Amount”float AmountDefined in OperatingSystemBankTypes.h:33 Amount to request from bank.
TimeToApprove
Section titled “TimeToApprove”FOperatingSystemRangeTime TimeToApproveDefined in OperatingSystemBankTypes.h:37 How long does the bank take to process the request.
Referenced by
Section titled “Referenced by”ApprovalChance
Section titled “ApprovalChance”float ApprovalChanceDefined in OperatingSystemBankTypes.h:41 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.
AccountNumber
Section titled “AccountNumber”int64 AccountNumberDefined in OperatingSystemBankTypes.h:56 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.
See also: RequestFund()
See also: GetAccountNumber()
See also: SetAccountNumber()
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
bool | IsValid const inline | Checks if the bank request is valid. |
bool | CanApprove const inline | Checks if the bank request can be approved. |
FOperatingSystemRequestFund inline | Default constructor | |
FOperatingSystemRequestFund 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. |
IsValid
Section titled “IsValid”const inline
inline bool IsValid() constDefined in OperatingSystemBankTypes.h:73 Checks if the bank request is valid.
The IsValid() method checks if the bank request is valid based on the following conditions:
-
The amount is greater than or equal to 1.0.
-
The TimeToApprove is valid.
-
The approval chance is greater than KINDA_SMALL_NUMBER.
-
The account number is within the range defined by ACC_MIN and ACC_MAX in FOperatingSystemBankSetting.
Returns
Section titled “Returns”True if the bank request is valid, false otherwise.
See also: FOperatingSystemRequestFund
See also: FOperatingSystemRangeTime
See also: FOperatingSystemBankSetting
Referenced by
Section titled “Referenced by”References
Section titled “References”CanApprove
Section titled “CanApprove”const inline
inline bool CanApprove() constDefined in OperatingSystemBankTypes.h:93 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.
Returns
Section titled “Returns”True if the bank request can be approved, false otherwise.
See also: FOperatingSystemRequestFund
See also: ApprovalChance
Referenced by
Section titled “Referenced by”FOperatingSystemRequestFund
Section titled “FOperatingSystemRequestFund”inline
inline FOperatingSystemRequestFund()Defined in OperatingSystemBankTypes.h:99 Default constructor
FOperatingSystemRequestFund
Section titled “FOperatingSystemRequestFund”inline
inline FOperatingSystemRequestFund(const int32 & Amount, const FOperatingSystemRangeTime & TimeToApprove, const float & ApprovalChance, const int64 & AccountNumber)Defined in OperatingSystemBankTypes.h:119 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);
Parameters
Section titled “Parameters”-
AmountThe amount to request from the bank. Must be a positive integer value. -
TimeToApproveThe time it takes for the bank to process the request. Must be a valid time range. -
ApprovalChanceA random chance of the bank approving the request, ranging from 0.0 to 1.0. -
AccountNumberThe account number associated with the fund request. Must be a valid 64-bit integer value.