#include <gamepp.h>
|
std::string | getWindowTitle () const |
| Get the human-readable window title.
|
|
sourcepp::math::Vec2i | getWindowPos () const |
| Get the window position on-screen.
|
|
sourcepp::math::Vec2i | getWindowSize () const |
| Get the window size on-screen.
|
|
const GameInstance & | command (std::string_view command) const |
| Send a command to the engine (ran as if it was entered into the console by the user).
|
|
const GameInstance & | inputBegin (std::string_view input) const |
| Begin "pressing" an input such as forward or left.
|
|
const GameInstance & | inputEnd (std::string_view input) const |
| End "pressing" an input such as forward or left.
|
|
const GameInstance & | inputOnce (std::string_view input) const |
| Begin and end "pressing" an input in one tick, like tapping the use key.
|
|
const GameInstance & | inputHold (std::string_view input, double sec) const |
| Begin and end "pressing" an input in the given timespan, like holding the use key.
|
|
const GameInstance & | wait (double sec) const |
| Sleep on the current thread for the given number of seconds.
|
|
|
static std::optional< GameInstance > | find (std::string_view windowNameOverride="") |
| Find a running instance of a Source engine game.
|
|
Definition at line 11 of file gamepp.h.
◆ GameInstance()
gamepp::GameInstance::GameInstance |
( |
| ) |
|
|
protecteddefault |
◆ command()
const GameInstance & GameInstance::command |
( |
std::string_view |
command | ) |
const |
Send a command to the engine (ran as if it was entered into the console by the user).
- Parameters
-
command | The command to run. |
- Returns
- This GameInstance.
Definition at line 83 of file gamepp.cpp.
◆ find()
std::optional< GameInstance > GameInstance::find |
( |
std::string_view |
windowNameOverride = "" | ) |
|
|
static |
Find a running instance of a Source engine game.
Note that this function will only ever succeed on Windows, because Valve never bothered to expose this functionality on Linux.
- Parameters
-
windowNameOverride | The classname of the window to search for, e.g. "Valve001". If unspecified it will check for "Valve001" and "Strata001". |
- Returns
- A GameInstance if a game is located.
Definition at line 67 of file gamepp.cpp.
◆ getWindowPos()
math::Vec2i GameInstance::getWindowPos |
( |
| ) |
const |
Get the window position on-screen.
- Returns
- The window position.
Definition at line 75 of file gamepp.cpp.
◆ getWindowSize()
math::Vec2i GameInstance::getWindowSize |
( |
| ) |
const |
Get the window size on-screen.
- Returns
- The window size.
Definition at line 79 of file gamepp.cpp.
◆ getWindowTitle()
std::string GameInstance::getWindowTitle |
( |
| ) |
const |
Get the human-readable window title.
- Returns
- The window title.
Definition at line 71 of file gamepp.cpp.
◆ inputBegin()
const GameInstance & GameInstance::inputBegin |
( |
std::string_view |
input | ) |
const |
Begin "pressing" an input such as forward or left.
- Parameters
-
input | The input to run (without the plus sign prefix). |
- Returns
- This GameInstance.
Definition at line 89 of file gamepp.cpp.
◆ inputEnd()
const GameInstance & GameInstance::inputEnd |
( |
std::string_view |
input | ) |
const |
End "pressing" an input such as forward or left.
- Parameters
-
input | The input to run (without the minus sign prefix). |
- Returns
- This GameInstance.
Definition at line 94 of file gamepp.cpp.
◆ inputHold()
const GameInstance & GameInstance::inputHold |
( |
std::string_view |
input, |
|
|
double |
sec |
|
) |
| const |
Begin and end "pressing" an input in the given timespan, like holding the use key.
- Parameters
-
input | The input to run (without any prefix). |
sec | The time to hold the input for. |
- Returns
- This GameInstance.
Definition at line 104 of file gamepp.cpp.
◆ inputOnce()
const GameInstance & GameInstance::inputOnce |
( |
std::string_view |
input | ) |
const |
Begin and end "pressing" an input in one tick, like tapping the use key.
- Parameters
-
input | The input to run (without any prefix). |
- Returns
- This GameInstance.
Definition at line 99 of file gamepp.cpp.
◆ wait()
Sleep on the current thread for the given number of seconds.
- Parameters
-
sec | The number of seconds. |
- Returns
- This GameInstance.
Definition at line 109 of file gamepp.cpp.
◆ hwnd
void* gamepp::GameInstance::hwnd |
|
protected |
The documentation for this class was generated from the following files: