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

#include "OperatingSystemCreditCardSetting.h"

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

Public Member Functions

FORCEINLINE bool IsValid () const
 
FORCEINLINE int64 GenerateCardNumber () const
 
FORCEINLINE int32 GenerateCVV () const
 
 FOperatingSystemCreditCardSetting ()
 

Public Attributes

FName Name
 
uint8 bEnableCardNumberPrefix: 1
 
uint8 CardNumberPrefix
 
uint8 CvvLength
 
uint8 ExpiryYearOffset
 
TSoftObjectPtr< UObject > Icon
 

Static Public Attributes

static constexpr const int64 CARD_MIN
 Represents the minimum value that a credit card number can have. It is a static constexpr variable of type int64. The value of CARD_MIN is 1000000000000000.
 
static constexpr const int64 CARD_MAX
 Represents the maximum value that a credit card number can have. It is a static constexpr variable of type int64. The value of CARD_MAX is 9000000000000000.
 
static constexpr const int32 CVV_MIN
 
static constexpr const int32 CVV_MAX
 
static constexpr const uint8 CARD_PREFIX_MIN
 Represents the minimum value for the card number prefix.
 
static constexpr const uint8 CARD_PREFIX_MAX
 

Detailed Description

Represents credit card settings for the operating system. Each instance of this struct represents a specific credit card type, such as Mastercard or Visa.

Constructor & Destructor Documentation

◆ FOperatingSystemCreditCardSetting()

FOperatingSystemCreditCardSetting::FOperatingSystemCreditCardSetting ( )
inline

Default constructor for the FOperatingSystemCreditCardSetting struct. Initializes the credit card settings with default values.

Returns
A new instance of FOperatingSystemCreditCardSetting with default values.

Member Function Documentation

◆ GenerateCardNumber()

FORCEINLINE int64 FOperatingSystemCreditCardSetting::GenerateCardNumber ( ) const
inline

Generates a random credit card number.

Returns
A randomly generated credit card number as an integer.
Remarks
This method generates a random credit card number by combining a prefix and a suffix. The prefix is determined based on the value of bEnableCardNumberPrefix variable. If bEnableCardNumberPrefix is true, the prefix is equal to CardNumberPrefix. If bEnableCardNumberPrefix is false, the prefix is a random number between CARD_PREFIX_MIN and CARD_PREFIX_MAX. The suffix is a randomly generated 14-digit number. The prefix and suffix are combined into a string, and then converted to an integer using FCString::Atoi64().
See also
bEnableCardNumberPrefix
CardNumberPrefix
CARD_PREFIX_MIN
CARD_PREFIX_MAX
GenerateRandomInt64
Note
The generated credit card number is not guaranteed to be a valid or unique number. It is solely for testing or simulation purposes.
Here is the call graph for this function:

◆ GenerateCVV()

FORCEINLINE int32 FOperatingSystemCreditCardSetting::GenerateCVV ( ) const
inline

Generates a Card Verification Value (CVV) for the credit card.

If the CVV length is 3, a random number between CVV_MIN and 999 (inclusive) is generated and returned. Otherwise, a random number between 1000 and CVV_MAX (inclusive) is generated and returned.

Returns
The generated CVV.

◆ IsValid()

FORCEINLINE bool FOperatingSystemCreditCardSetting::IsValid ( ) const
inline

Check if the instance of the class OperatingSystemCreditCardSetting is valid.

The IsValid method checks if all the necessary properties of the credit card setting are valid according to the following conditions:

  • The Name property is not None.
  • The CardNumberPrefix is within the range specified by CARD_PREFIX_MIN and CARD_PREFIX_MAX.
  • The CvvLength is either 3 or 4.
  • The ExpiryYearOffset is within the range of 1 to 5.
Returns
true if all the conditions are met and the credit card setting is valid, false otherwise.

Member Data Documentation

◆ bEnableCardNumberPrefix

uint8 FOperatingSystemCreditCardSetting::bEnableCardNumberPrefix

Indicates whether the card number prefix is enabled. When enabled, a specific CardNumberPrefix value must be provided. Otherwise, a random prefix will be generated within the range (CARD_PREFIX_MIN (set to 10), CARD_PREFIX_MAX (set to 99)).

◆ CARD_MAX

constexpr const int64 FOperatingSystemCreditCardSetting::CARD_MAX
staticconstexpr

Represents the maximum value that a credit card number can have. It is a static constexpr variable of type int64. The value of CARD_MAX is 9000000000000000.

◆ CARD_MIN

constexpr const int64 FOperatingSystemCreditCardSetting::CARD_MIN
staticconstexpr

Represents the minimum value that a credit card number can have. It is a static constexpr variable of type int64. The value of CARD_MIN is 1000000000000000.

◆ CARD_PREFIX_MAX

constexpr const uint8 FOperatingSystemCreditCardSetting::CARD_PREFIX_MAX
staticconstexpr

Represents the maximum value that a credit card number prefix can have.

CARD_PREFIX_MAX is a static constexpr variable of type uint8. The value of CARD_PREFIX_MAX is 99. It is used to specify the maximum value that a credit card number prefix can have. The credit card number prefix is used to specify a specific range of credit card numbers.

See also
FOperatingSystemCreditCardSetting
OperatingSystemCreditCardSetting.h

◆ CARD_PREFIX_MIN

constexpr const uint8 FOperatingSystemCreditCardSetting::CARD_PREFIX_MIN
staticconstexpr

Represents the minimum value for the card number prefix.

The CARD_PREFIX_MIN is a static constexpr variable of type uint8. The value of CARD_PREFIX_MIN is 10. It is used to specify the minimum value that a credit card number prefix can have. The credit card number prefix is used to specify a specific range of credit card numbers.

See also
FOperatingSystemCreditCardSetting
OperatingSystemCreditCardSetting.h

◆ CardNumberPrefix

uint8 FOperatingSystemCreditCardSetting::CardNumberPrefix

Represents the prefix of a credit card number. The CardNumberPrefix is a value between 10 and 99 (inclusive). It is used to specify a specific range of credit card numbers. If the CardNumberPrefix is enabled, a specific value must be provided. Otherwise, a random prefix will be generated within the valid range.

◆ CVV_MAX

constexpr const int32 FOperatingSystemCreditCardSetting::CVV_MAX
staticconstexpr

Represents the maximum value that a CVV (Card Verification Value) can have.

CVV_MAX is a static constant variable of type int32. The value of CVV_MAX is 9999. It is used to specify the maximum possible value of the CVV code for a credit card. The CVV code is a security feature of credit cards that is typically found on the back of the card.

See also
FOperatingSystemCreditCardSetting
OperatingSystemBankTypes.h

◆ CVV_MIN

constexpr const int32 FOperatingSystemCreditCardSetting::CVV_MIN
staticconstexpr

Represents the minimum value that a CVV (Card Verification Value) can have. It is a static constant variable of type int32. The value of CVV_MIN is 100.

◆ CvvLength

uint8 FOperatingSystemCreditCardSetting::CvvLength

Represents the length of the CVV (Card Verification Value) for a credit card. The CVV length is either 3 or 4. It is used to specify the number of digits in the CVV code. The CVV code is a security feature of credit cards that is typically found on the back of the card.

◆ ExpiryYearOffset

uint8 FOperatingSystemCreditCardSetting::ExpiryYearOffset

Represents the offset of the expiry year for a credit card. The ExpiryYearOffset is a value between 1 and 5 (inclusive). It is used to specify the number of years to add to the current year to calculate the expiry year of the credit card. For example, if ExpiryYearOffset is set to 2 and the current year is 2022, the expiry year of the credit card will be 2024.

◆ Icon

TSoftObjectPtr<UObject> FOperatingSystemCreditCardSetting::Icon

Represents the icon for a credit card. The icon is a soft reference to a UObject, such as a Texture or MaterialInterface. It can be displayed as a thumbnail and is used to visually represent the credit card type.

Example usage: Icon = "/Game/Textures/CardIcons/Visa_Icon"

See also
FOperatingSystemCreditCardSetting

◆ Name

FName FOperatingSystemCreditCardSetting::Name

Name of this card. Like Master card, Visa etc.


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