Skip to content

UOperatingSystemGameSubsystem

#include <OperatingSystemSimulator/Public/Subsystems/OperatingSystemGameSubsystem.h>
class UOperatingSystemGameSubsystem

Defined in OperatingSystemGameSubsystem.h:18

Inherits: UGameInstanceSubsystem

---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemGameSubsystem["UOperatingSystemGameSubsystem"]
  class UGameInstanceSubsystem["UGameInstanceSubsystem"]
  UGameInstanceSubsystem <|-- UOperatingSystemGameSubsystem
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemGameSubsystem["UOperatingSystemGameSubsystem"]
  class FOperatingSystemUser["FOperatingSystemUser"]
  UOperatingSystemGameSubsystem *-- FOperatingSystemUser
---
config:
  class:
    hideEmptyMembersBox: true
---
classDiagram
  class UOperatingSystemGameSubsystem {
    +Initialize(FSubsystemCollectionBase &Collection) overr
    +Deinitialize() override
    +RequestFundsFromBank(const FOperatingSystemUser &TargetUser, con
    +AddUserWhoRequestedFund(const FOperatingSystemUser &TargetUser) FTimerHandle &
    +RemoveUserWhoRequestedFund(const FOperatingSystemUser &TargetUser)
    +Get(const UObject *WorldContextObject) UOperatingSystemGameSubsystem() *
    +UsersRequestedForFund : TMap< FOperatingSystemUser(), FTimerHand
  }

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

ReturnNameDescription
voidInitialize virtual override
voidDeinitialize virtual override
voidRequestFundsFromBankRequests 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.
FTimerHandle &AddUserWhoRequestedFund inlineAdds 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.
voidRemoveUserWhoRequestedFund inlineRemoves 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.

virtual override

virtual void Initialize(FSubsystemCollectionBase & Collection) override

Defined in OperatingSystemGameSubsystem.h:35


virtual override

virtual void Deinitialize() override

Defined in OperatingSystemGameSubsystem.h:36


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

Defined in OperatingSystemGameSubsystem.h:48 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.

  • TargetUser The user for whom funds are being requested.

  • FundDetails The details of the fund request, including the account number, amount, and time to approve.

  • OutError An output parameter to hold any error that may occur during the fund request process.


inline

inline FTimerHandle & AddUserWhoRequestedFund(const FOperatingSystemUser & TargetUser)

Defined in OperatingSystemGameSubsystem.h:57 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.

  • TargetUser The user who requested funds.

A reference to the timer handle associated with the user’s fund request.


inline

inline void RemoveUserWhoRequestedFund(const FOperatingSystemUser & TargetUser)

Defined in OperatingSystemGameSubsystem.h:68 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.

  • TargetUser The user to remove from the list.
ReturnNameDescription
UOperatingSystemGameSubsystem *Get staticReturns the UOperatingSystemGameSubsystem instance associated with the specified UObject.

static

static UOperatingSystemGameSubsystem * Get(const UObject * WorldContextObject)

Defined in OperatingSystemGameSubsystem.h:33 Returns the UOperatingSystemGameSubsystem instance associated with the specified UObject.

The UOperatingSystemGameSubsystem instance associated with the specified UObject.

ReturnNameDescription
TMap< FOperatingSystemUser, FTimerHandle >UsersRequestedForFund

TMap< FOperatingSystemUser, FTimerHandle > UsersRequestedForFund

Defined in OperatingSystemGameSubsystem.h:23