Operating System Simulator Plugin  3.5.1
Unreal Engine plugin that simulates an Operating System Environment
Loading...
Searching...
No Matches
FOperatingSystemRequestFund Struct Reference

Struct representing a fund request to the bank in the operating system. More...

#include "OperatingSystemBankTypes.h"

Collaboration diagram for FOperatingSystemRequestFund:
[legend]

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
 

Detailed Description

Struct representing a fund request to the bank in the operating system.

Constructor & Destructor Documentation

◆ FOperatingSystemRequestFund() [1/2]

FOperatingSystemRequestFund::FOperatingSystemRequestFund ( )
inline

Default constructor

◆ FOperatingSystemRequestFund() [2/2]

FOperatingSystemRequestFund::FOperatingSystemRequestFund ( const int32 & Amount,
const FOperatingSystemRangeTime & TimeToApprove,
const float & ApprovalChance,
const int64 & AccountNumber )
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);

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.

Member Function Documentation

◆ CanApprove()

FORCEINLINE bool FOperatingSystemRequestFund::CanApprove ( ) const
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.

Returns
True if the bank request can be approved, false otherwise.
See also
FOperatingSystemRequestFund
ApprovalChance
Here is the caller graph for this function:

◆ IsValid()

FORCEINLINE bool FOperatingSystemRequestFund::IsValid ( ) const
inline

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
True if the bank request is valid, false otherwise.
See also
FOperatingSystemRequestFund
FOperatingSystemRangeTime
FOperatingSystemBankSetting
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ AccountNumber

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.

Note
This variable should only be accessed and modified by the necessary components responsible for handling fund requests.
See also
RequestFund()
GetAccountNumber()
SetAccountNumber()

◆ Amount

float FOperatingSystemRequestFund::Amount

Amount to request from bank.

◆ ApprovalChance

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.

◆ TimeToApprove

FOperatingSystemRangeTime FOperatingSystemRequestFund::TimeToApprove

How long does the bank take to process the request.


The documentation for this struct was generated from the following file: