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

#include "OperatingSystemGameSubsystem.h"

Inheritance diagram for UOperatingSystemGameSubsystem:
[legend]
Collaboration diagram for UOperatingSystemGameSubsystem:
[legend]

Public Member Functions

virtual void Initialize (FSubsystemCollectionBase &Collection) override
 
virtual void Deinitialize () override
 
void RequestFundsFromBank (const FOperatingSystemUser &TargetUser, const FOperatingSystemRequestFund &FundDetails, FGenericError &OutError)
 Requests funds from a bank for a specific user. The method checks if there is already a pending request for the user, if the user is a valid registered user, and if the fund details are valid. If any of these conditions are not met, an error is returned. Otherwise, a timer is set for the specified time to approve the fund request. Upon approval, the funds will be transferred to the user's account. If the request is not approved, an error will be logged. Finally, the user who requested the funds and the corresponding JSON file will be removed.
 
FORCEINLINE FTimerHandle & AddUserWhoRequestedFund (const FOperatingSystemUser &TargetUser)
 Adds a user who requested funds to the list. This method adds a user who requested funds to the list of users who requested funds from the bank.
 
FORCEINLINE void RemoveUserWhoRequestedFund (const FOperatingSystemUser &TargetUser)
 Removes a user who requested funds from the list of users who requested funds from the bank. The method removes the specified TargetUser from the UsersRequestedForFund array and then compacts and shrinks the array to remove any empty slots.
 

Static Public Member Functions

static UOperatingSystemGameSubsystemGet (const UObject *WorldContextObject)
 Returns the UOperatingSystemGameSubsystem instance associated with the specified UObject.
 

Detailed Description

This class represents the game subsystem for the operating system. It provides functionality for requesting funds from a bank.

Member Function Documentation

◆ AddUserWhoRequestedFund()

FORCEINLINE FTimerHandle & UOperatingSystemGameSubsystem::AddUserWhoRequestedFund ( const FOperatingSystemUser & TargetUser)
inline

Adds a user who requested funds to the list. This method adds a user who requested funds to the list of users who requested funds from the bank.

Parameters
TargetUserThe user who requested funds.
Returns
A reference to the timer handle associated with the user's fund request.
Here is the caller graph for this function:

◆ Deinitialize()

void UOperatingSystemGameSubsystem::Deinitialize ( )
overridevirtual
Here is the call graph for this function:

◆ Get()

UOperatingSystemGameSubsystem * UOperatingSystemGameSubsystem::Get ( const UObject * WorldContextObject)
static

Returns the UOperatingSystemGameSubsystem instance associated with the specified UObject.

Parameters
WorldContextObjectThe UObject used to determine the UGameInstance and retrieve the UOperatingSystemGameSubsystem instance.
Returns
The UOperatingSystemGameSubsystem instance associated with the specified UObject.
Here is the caller graph for this function:

◆ Initialize()

void UOperatingSystemGameSubsystem::Initialize ( FSubsystemCollectionBase & Collection)
overridevirtual
Here is the call graph for this function:

◆ RemoveUserWhoRequestedFund()

FORCEINLINE void UOperatingSystemGameSubsystem::RemoveUserWhoRequestedFund ( const FOperatingSystemUser & TargetUser)
inline

Removes a user who requested funds from the list of users who requested funds from the bank. The method removes the specified TargetUser from the UsersRequestedForFund array and then compacts and shrinks the array to remove any empty slots.

Parameters
TargetUserThe user to remove from the list.
Here is the caller graph for this function:

◆ RequestFundsFromBank()

void UOperatingSystemGameSubsystem::RequestFundsFromBank ( const FOperatingSystemUser & TargetUser,
const FOperatingSystemRequestFund & FundDetails,
FGenericError & OutError )

Requests funds from a bank for a specific user. The method checks if there is already a pending request for the user, if the user is a valid registered user, and if the fund details are valid. If any of these conditions are not met, an error is returned. Otherwise, a timer is set for the specified time to approve the fund request. Upon approval, the funds will be transferred to the user's account. If the request is not approved, an error will be logged. Finally, the user who requested the funds and the corresponding JSON file will be removed.

Parameters
TargetUserThe user for whom funds are being requested.
FundDetailsThe details of the fund request, including the account number, amount, and time to approve.
OutErrorAn output parameter to hold any error that may occur during the fund request process.
Here is the call graph for this function:

The documentation for this class was generated from the following files: