Skip to content

FOperatingSystemRequestFund

#include <OperatingSystemSimulator/Public/Data/OperatingSystemBankTypes.h>
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class FOperatingSystemRequestFund["FOperatingSystemRequestFund"]
  class FOperatingSystemRangeTime["FOperatingSystemRangeTime"]
  FOperatingSystemRequestFund *-- FOperatingSystemRangeTime
---
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 FOperatingSystemRequestFund

Defined in OperatingSystemBankTypes.h:27 Struct representing a fund request to the bank in the operating system.

ReturnNameDescription
floatAmountAmount to request from bank.
FOperatingSystemRangeTimeTimeToApproveHow long does the bank take to process the request.
floatApprovalChanceRandom 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.
int64AccountNumberAccount number needed for fund request

float Amount

Defined in OperatingSystemBankTypes.h:33 Amount to request from bank.


FOperatingSystemRangeTime TimeToApprove

Defined in OperatingSystemBankTypes.h:37 How long does the bank take to process the request.


float ApprovalChance

Defined 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.


int64 AccountNumber

Defined 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()

ReturnNameDescription
boolIsValid const inlineChecks if the bank request is valid.
boolCanApprove const inlineChecks if the bank request can be approved.
FOperatingSystemRequestFund inlineDefault constructor
FOperatingSystemRequestFund inlineConstructs 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.

const inline

inline bool IsValid() const

Defined 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.

True if the bank request is valid, false otherwise.

See also: FOperatingSystemRequestFund

See also: FOperatingSystemRangeTime

See also: FOperatingSystemBankSetting


const inline

inline bool CanApprove() const

Defined 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.

True if the bank request can be approved, false otherwise.

See also: FOperatingSystemRequestFund

See also: ApprovalChance


inline

inline FOperatingSystemRequestFund()

Defined in OperatingSystemBankTypes.h:99 Default constructor


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);

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