V-Gears 0
Free Final Fantasy VII engine.
BaseFF7FieldScriptFormatter Class Reference

#include <FieldDataInstaller.h>

Inheritance diagram for BaseFF7FieldScriptFormatter:
Collaboration diagram for BaseFF7FieldScriptFormatter:

Public Member Functions

 BaseFF7FieldScriptFormatter (const std::string &field_name, const std::vector< std::string > &field_id_to_name_lookup, FieldSpawnPointsMap &spawn_points)
 Constructor. More...
 
virtual std::string GetSpawnPointName (unsigned int map_id, const std::string &entity, const std::string &function_name, unsigned int address) override
 Composes a spawn point name. More...
 
virtual std::string GetMapName (unsigned int map_id) override
 Retrieves a map name from it's ID. More...
 
virtual std::string GetFriendlyVarName (unsigned int bank, unsigned int addr) override
 Retrieves a user friendly variable name. More...
 
virtual std::string GetFriendlyEntityName (const std::string &entity) override
 Retrieves a user friendly entity name. More...
 
virtual std::string GetFriendlyCharName (int char_id) override
 Retrieves a user friendly character name. More...
 
virtual std::string GetFriendlyFunctionName (const std::string &entity, const std::string &function_name) override
 Retrieves a user friendly function name. More...
 
virtual std::string GetFunctionComment (const std::string &entity, const std::string &function_name) override
 Retrieves the header comment for a function in an entity. More...
 
- Public Member Functions inherited from FieldScriptFormatter
virtual void AddSpawnPoint (unsigned int map_id, const std::string &entity, const std::string &function_name, unsigned int address, int x, int y, int triangle_id, int angle)
 Adds an spawn point. More...
 
virtual std::string GetSpawnPointName (unsigned int map_id, const std::string &entity, const std::string &function_name, unsigned int address)
 Retrieves the name of a spawn point. More...
 
virtual std::string GetMapName (unsigned int map_id)
 Retrieves the name of a map. More...
 
- Public Member Functions inherited from ScriptFormatter
virtual ~ScriptFormatter ()=default
 
virtual std::string GetFriendlyVarName (unsigned int bank, unsigned int addr)
 Retrieves a friendly name for a variable. More...
 
virtual std::string GetFriendlyEntityName (const std::string &entity_name)
 Retrieves a friendly name for an entity. More...
 
virtual std::string GetFriendlyAnimationName (int animation_id, int id)
 Retrieves a friendly name for an animation. More...
 
virtual std::string GetFriendlyCharName (int char_id)
 Retrieves a friendly name for a character. More...
 
virtual std::string GetFriendlyFunctionName (const std::string &entity_name, const std::string &function_name)
 Retrieves a friendly name for a function. More...
 
virtual std::string GetFunctionComment (const std::string &entity_name, const std::string &function_name)
 Retrieves the header comment for a function in an entity. More...
 

Protected Attributes

std::string field_name_
 The field name. More...
 
FieldSpawnPointsMapspawn_points_
 The list of spawn points. More...
 
const std::vector< std::string > & field_id_to_name_lookup_
 Look up table relatingfield IDs and names. More...
 

Constructor & Destructor Documentation

◆ BaseFF7FieldScriptFormatter()

BaseFF7FieldScriptFormatter::BaseFF7FieldScriptFormatter ( const std::string &  field_name,
const std::vector< std::string > &  field_id_to_name_lookup,
FieldSpawnPointsMap spawn_points 
)
inline

Constructor.

Parameters
[in]field_nameThe field name.
[in]field_id_to_name_lookupField name lookup table to use.
[in]spawn_pointsThe list of spawn points.

Member Function Documentation

◆ GetFriendlyCharName()

virtual std::string BaseFF7FieldScriptFormatter::GetFriendlyCharName ( int  char_id)
inlineoverridevirtual

Retrieves a user friendly character name.

Parameters
[in]char_idCharacter ID.
Returns
Friendly name for the entity, or an empty string if it doesn't have one assigned.

Reimplemented from ScriptFormatter.

◆ GetFriendlyEntityName()

virtual std::string BaseFF7FieldScriptFormatter::GetFriendlyEntityName ( const std::string &  entity)
inlineoverridevirtual

Retrieves a user friendly entity name.

Parameters
[in]entityEntity name.
Returns
Friendly name for the entity, or the current name if it doesn't have one assigned.

Reimplemented from ScriptFormatter.

◆ GetFriendlyFunctionName()

virtual std::string BaseFF7FieldScriptFormatter::GetFriendlyFunctionName ( const std::string &  entity,
const std::string &  function_name 
)
inlineoverridevirtual

Retrieves a user friendly function name.

Parameters
[in]entityThe name of the entity the function belongs to.
[in]function_nameFunction name.
Returns
Friendly name for the function, or the current name if it doesn't have one assigned.

Reimplemented from ScriptFormatter.

◆ GetFriendlyVarName()

virtual std::string BaseFF7FieldScriptFormatter::GetFriendlyVarName ( unsigned int  bank,
unsigned int  addr 
)
inlineoverridevirtual

Retrieves a user friendly variable name.

Parameters
[in]bankVariable bank.
[in]addrVariable address.
Returns
Friendly name for the variable, or an empty string if it doesn't have one assigned.

Reimplemented from ScriptFormatter.

◆ GetFunctionComment()

virtual std::string BaseFF7FieldScriptFormatter::GetFunctionComment ( const std::string &  entity,
const std::string &  function_name 
)
inlineoverridevirtual

Retrieves the header comment for a function in an entity.

Parameters
[in]entityThe name of the entity the function belongs to.
[in]function_nameFunction name.
Returns
Friendly comment for the function, or an empty string if it doesn't have one assigned.

Reimplemented from ScriptFormatter.

◆ GetMapName()

virtual std::string BaseFF7FieldScriptFormatter::GetMapName ( unsigned int  map_id)
inlineoverridevirtual

Retrieves a map name from it's ID.

Parameters
[in]map_idThe map ID.
Returns
The map name.

Reimplemented from FieldScriptFormatter.

◆ GetSpawnPointName()

virtual std::string BaseFF7FieldScriptFormatter::GetSpawnPointName ( unsigned int  map_id,
const std::string &  entity,
const std::string &  function_name,
unsigned int  address 
)
inlineoverridevirtual

Composes a spawn point name.

The name will have the format {FIELD_NAME}_{ENTITY}_{FUNCTION_NAME}_addr_{ADDRESS}

Parameters
[in]map_idUnused.
[in]entityEntity name.
[in]function_nameName of the function.
[in]address
Todo:
Understand and document.
Returns
The composed spawn point name.

Reimplemented from FieldScriptFormatter.

Member Data Documentation

◆ field_id_to_name_lookup_

const std::vector<std::string>& BaseFF7FieldScriptFormatter::field_id_to_name_lookup_
protected

Look up table relatingfield IDs and names.

◆ field_name_

std::string BaseFF7FieldScriptFormatter::field_name_
protected

The field name.

◆ spawn_points_

FieldSpawnPointsMap& BaseFF7FieldScriptFormatter::spawn_points_
protected

The list of spawn points.


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