![]() |
V-Gears 0
Free Final Fantasy VII engine.
|
Represents an entity. More...
#include <FieldEngine.h>
Public Member Functions | |
Entity ()=default | |
Entity constructor. More... | |
Entity (const std::string &name, size_t index) | |
Entity constructor. More... | |
std::string | GetName () const |
Retrieves the entity name. More... | |
size_t | GetIndex () const |
Retrieves the entity index. More... | |
std::string | FunctionByIndex (size_t index) const |
Retrieves a function. More... | |
void | AddFunction (const std::string &name, size_t index) |
Adds a function to the engine. More... | |
void | MarkAsLine (bool line, std::vector< float > point_a, std::vector< float > point_b) |
Marks the entity as a line. More... | |
bool | IsLine () |
Checks if the entity is a line. More... | |
std::vector< float > | GetLinePointA () |
Retrieves the first point of the line entity. More... | |
std::vector< float > | GetLinePointB () |
Retrieves the second point of the line entity. More... | |
Private Attributes | |
std::string | name_ |
Entity name. More... | |
size_t | index_ |
Entity index. More... | |
std::map< size_t, std::string > | functions_ |
Entity function (script) list. More... | |
bool | is_line_ |
Indicates if the entity is a line. More... | |
std::vector< float > | point_a_ |
The first point of a line entity. More... | |
std::vector< float > | point_b_ |
The second point of a line entity. More... | |
Represents an entity.
An entity can be almost anything in a field map: the playable character, an NPC, an item, a line...
|
default |
Entity constructor.
It doesn't initialize any of the fields.
FieldEngine::Entity::Entity | ( | const std::string & | name, |
size_t | index | ||
) |
void FieldEngine::Entity::AddFunction | ( | const std::string & | name, |
size_t | index | ||
) |
std::string FieldEngine::Entity::FunctionByIndex | ( | size_t | index | ) | const |
Retrieves a function.
Retrieves the name of a function from it's index.
[in] | index | Function index. |
DecompilerException | if there is no function with the specified index. |
size_t FieldEngine::Entity::GetIndex | ( | ) | const |
Retrieves the entity index.
The index is the one at which appears in the original game script.
std::vector< float > FieldEngine::Entity::GetLinePointA | ( | ) |
Retrieves the first point of the line entity.
If the entity is not a line, the behavior is undefined.
std::vector< float > FieldEngine::Entity::GetLinePointB | ( | ) |
Retrieves the second point of the line entity.
If the entity is not a line, the behavior is undefined.
std::string FieldEngine::Entity::GetName | ( | ) | const |
Retrieves the entity name.
bool FieldEngine::Entity::IsLine | ( | ) |
Checks if the entity is a line.
Note that an entity is not considered to be a line until a function has been found containing the opcode LINE and {
void FieldEngine::Entity::MarkAsLine | ( | bool | line, |
std::vector< float > | point_a, | ||
std::vector< float > | point_b | ||
) |
Marks the entity as a line.
[in] | line | True to mark the entity as a line, false to unmark it. |
[in] | point_a | First point of the line. Can be null if line is false. |
[in] | point_b | Second point of the line. Can be null if line is false. |
|
private |
Entity function (script) list.
|
private |
Entity index.
|
private |
Indicates if the entity is a line.
|
private |
Entity name.
|
private |
The first point of a line entity.
If the entity is not a line, it may not be initializer.
|
private |
The second point of a line entity.
If the entity is not a line, it may not be initializer.