Operating System Simulator Plugin
3.5.1
Unreal Engine plugin that simulates an Operating System Environment
|
#include "OperatingSystemTerminalHistory.h"
Public Member Functions | |
UOperatingSystemTerminalHistory () | |
void | AddToHistory (const FString &NewCommand) |
Adds a new command to the command history. The command is specified as a FString parameter named NewCommand . The index of the command history is reset to INDEX_NONE , indicating that there is no current command selected. | |
void | ClearHistory () |
Clears the command history by resetting the command history index to INDEX_NONE and emptying the command history array. | |
bool | GetNextCommand (FString &OutCommand) |
Retrieves the next command from the command history by incrementing the command history index and retrieving the command at the new index. If the command history is empty or the index exceeds the command history size, the method returns false and does not modify the OutCommand parameter. Otherwise, it returns true and assigns the retrieved command to the OutCommand parameter. | |
bool | GetPreviousCommand (FString &OutCommand) |
Retrieves the command that was entered before the current command in the command history. It decrements the CommandHistoryIndex to move to the previous command. If the CommandHistoryIndex becomes invalid (i.e., less than zero or greater than or equal to the size of the command history array), it is set to zero, which represents the first command in the history. | |
Public Member Functions inherited from UOperatingSystemProgramData | |
UOperatingSystemProgramData () | |
Public Member Functions inherited from UOperatingSystemDataObject | |
template<class T > | |
T * | GetParentObject () const |
OPERATINGSYSTEMSIMULATOR_API void | SetTickEnabled (const bool bEnable) |
OPERATINGSYSTEMSIMULATOR_API bool | IsTickEnabled () const |
Protected Member Functions | |
virtual bool | ShouldCreate () const override |
virtual void | OnCreate () override |
Protected Member Functions inherited from UOperatingSystemDataObject | |
virtual OPERATINGSYSTEMSIMULATOR_API void | Tick (const float &DeltaSeconds) |
The Tick method receives the time elapsed since the last frame update and performs any necessary updates or computations. | |
virtual OPERATINGSYSTEMSIMULATOR_API void | OnValidate (FGenericError &OutError) |
This method is called to validate the data object. | |
void | K2_OnCreate () |
K2_OnCreate. | |
void | K2_Tick (const float &DeltaSeconds) |
K2_Tick method is an event meant to be overridden in Blueprint subclasses of OperatingSystemDataObject. It allows subclasses to define custom behavior that should be executed every tick. | |
bool | K2_ShouldCreate () const |
Indicates whether the operating system data object should be created. | |
Additional Inherited Members | |
Static Public Member Functions inherited from UOperatingSystemDataObject | |
static OPERATINGSYSTEMSIMULATOR_API UOperatingSystemDataObject * | CreateDataObj (UObject *OwningObject, const TSoftClassPtr< UOperatingSystemDataObject > &DataClassPtr) |
template<class T > | |
static OPERATINGSYSTEMSIMULATOR_API T * | CreateDataObj (UObject *OwningObject, TSoftClassPtr< UOperatingSystemDataObject > DataClassPtr) |
This method creates a new instance of a data object of type T. | |
Protected Attributes inherited from UOperatingSystemProgramData | |
TWeakObjectPtr< UOperatingSystemBaseProgram > | ParentProgram |
Protected Attributes inherited from UOperatingSystemDataObject | |
TWeakObjectPtr< UObject > | ParentObject |
uint8 | bStartWithTickEnabled: 1 |
This class represents the history of commands entered in an operating system terminal. It stores the command history and provides methods to add to the history, clear the history, and retrieve previous and next commands.
UOperatingSystemTerminalHistory::UOperatingSystemTerminalHistory | ( | ) |
Adds a new command to the command history. The command is specified as a FString parameter named NewCommand
. The index of the command history is reset to INDEX_NONE
, indicating that there is no current command selected.
NewCommand | The new command to be added to the history. |
void UOperatingSystemTerminalHistory::ClearHistory | ( | ) |
Clears the command history by resetting the command history index to INDEX_NONE
and emptying the command history array.
Retrieves the next command from the command history by incrementing the command history index and retrieving the command at the new index. If the command history is empty or the index exceeds the command history size, the method returns false and does not modify the OutCommand parameter. Otherwise, it returns true and assigns the retrieved command to the OutCommand parameter.
OutCommand | The variable where the next command will be stored if it exists. |
Retrieves the command that was entered before the current command in the command history. It decrements the CommandHistoryIndex to move to the previous command. If the CommandHistoryIndex becomes invalid (i.e., less than zero or greater than or equal to the size of the command history array), it is set to zero, which represents the first command in the history.
If the command history is empty, the method returns false, indicating that there is no previous command. Otherwise, it returns true and assigns the retrieved command to the OutCommand parameter.
OutCommand | The variable where the previous command will be stored if it exists. |
|
overrideprotectedvirtual |
Determines whether the operating system terminal history should be created.
The OnCreate
method is invoked when the UOperatingSystemTerminalHistory
instance is created. It is responsible for initializing the command history, setting the parent terminal, and performing any other necessary setup.
Reimplemented from UOperatingSystemProgramData.
|
overrideprotectedvirtual |
Determines whether the operating system terminal history should be created.
Reimplemented from UOperatingSystemDataObject.