Annchienta::Engine Class Reference
List of all members.
Detailed Description
This is a class that holds most other classes and some general engine functionality. To obtain it, use
getEngine()
Constructor & Destructor Documentation
Annchienta::Engine::Engine |
( |
const char * |
writeDirectory = "." |
) |
|
Write directory is the directory where files such as save files and logs will be placed.
Annchienta::Engine::~Engine |
( |
|
) |
|
Member Function Documentation
void Annchienta::Engine::delay |
( |
int |
ms |
) |
const |
Waits a time and then returns.
- Parameters:
-
| ms | Number of milliseconds to wait. |
bool Annchienta::Engine::evaluatePythonBoolean |
( |
const char * |
code, |
|
|
const char * |
conditional | |
|
) |
| | |
Returns the value of a Python boolean expression. an example could be
engine->evaluatePythonBoolean( "a=3", "a>1" );
- Parameters:
-
| code | Code to be executed before checking the boolean value. |
| conditional | The boolean expression. |
- Note:
- Not available in Python.
unsigned int Annchienta::Engine::getTicks |
( |
|
) |
const |
Get the time since the engine was initted.
- Returns:
- The number of milliseconds passed since initting.
const char* Annchienta::Engine::getWriteDirectory |
( |
|
) |
const |
Finds out the writing directory. This should be used if you want to know where to place save files etc.
bool Annchienta::Engine::isValidFile |
( |
const char * |
filename |
) |
const |
Checks if the given file exists and can be read.
- Parameters:
-
| filename | File to be checked. |
- Returns:
- If the file can be accessed.
void Annchienta::Engine::runPythonCode |
( |
const char * |
code |
) |
const |
Safe method for running Python code.
- Parameters:
-
| code | Code to be executed. |
- Note:
- Not available in Python.
void Annchienta::Engine::runPythonScript |
( |
const char * |
filename |
) |
const |
Safe method for running Python scripts.
- Parameters:
-
| filename | The script to be ran. |
- Note:
- Not available in Python.
void Annchienta::Engine::setPythonBoolean |
( |
bool |
b |
) |
|
Used internally by evaluatePythonBoolean(). I can't imagine this is needed in any other situation, so please don't use it.
void Annchienta::Engine::setWindowTitle |
( |
const char * |
title |
) |
const |
Sets the window caption.
- Parameters:
-
| title | The new window caption. |
void Annchienta::Engine::setWriteDirectory |
( |
const char * |
directory |
) |
|
This changes the write directory, which is the directory where log and save files should be placed. Use this with care, and preferably never as it is better to specify the writing directory when calling the Annchienta::init() function.
- Parameters:
-
| directory | Path to the new writing directory. |
void Annchienta::Engine::toPythonCode |
( |
char ** |
code |
) |
|
Converts a string to proper Python code. For now, this means removing extra spaces at the end.
- Parameters:
-
| code | Code to be converted. |
- Note:
- Not available in Python.
void Annchienta::Engine::write |
( |
const char * |
text |
) |
const |
This simply writes some text to stdout. This is preferred to the default Python "print" function because that might be unsafe on certain operating systems. (Meaning: windows.)
- Parameters:
-
| text | The string to write. |
Member Data Documentation