V-Gears 0
Free Final Fantasy VII engine.
VGears::MapFile Class Reference

Handles map files. More...

#include <VGearsMapFile.h>

Inheritance diagram for VGears::MapFile:
Collaboration diagram for VGears::MapFile:

Public Types

typedef EntityPoint Point
 
typedef std::vector< PointPointList
 
typedef EntityTrigger Trigger
 
typedef std::vector< TriggerTriggerList
 

Public Member Functions

 MapFile (Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool is_manual=false, Ogre::ManualResourceLoader *loader=NULL)
 Constructor. More...
 
virtual ~MapFile ()
 Destructor. More...
 
virtual const StringGetScriptName () const
 Retrieves the map script name. More...
 
virtual const StringGetBackground2dName () const
 Retrieves the map background file name. More...
 
virtual const StringGetTextsName () const
 Retrieves the map texts file name. More...
 
virtual const StringGetWalkmeshName () const
 Retrieves the map walkmesh file name. More...
 
virtual const Ogre::Real & GetForwardDirection () const
 Retrieves the map forward direction. More...
 
virtual PointListGetPoints ()
 Retrieves the list of entity points in the map. More...
 
virtual TriggerListGetTriggers ()
 Retrieves the map triggers. More...
 
virtual void SetScriptName (const String &script_name)
 Sets the map script name. More...
 
virtual void SetBackground2dName (const String &background2d_name)
 Sets the map background file name. More...
 
virtual void SetTextsName (const String &texts_name)
 Sets the map field texts file name. More...
 
virtual void SetWalkmeshName (const String &walkmesh_name)
 Sets the map walkmesh file name. More...
 
virtual void SetForwardDirection (const Ogre::Real &forward_direction)
 Sets the map forward direction. More...
 
- Public Member Functions inherited from VGears::Resource
 Resource (Ogre::ResourceManager *creator, const String &name, Ogre::ResourceHandle handle, const String &group, bool manual, Ogre::ManualResourceLoader *loader)
 Constructor. More...
 
virtual ~Resource ()=default
 Destructor. More...
 

Static Public Attributes

static const String RESOURCE_TYPE
 The type of resource. More...
 

Protected Member Functions

virtual void loadImpl () override
 Loads the file. More...
 
virtual void unloadImpl () override
 Unloads the file. More...
 
virtual size_t calculateSize () const
 Calculates the size of the map. More...
 
- Protected Member Functions inherited from VGears::Resource
virtual Ogre::DataStreamPtr openResource ()
 Opens the resource. More...
 

Private Attributes

String script_name_
 The script file name. More...
 
String background_2d_name_
 The background file name. More...
 
String texts_name_
 The background file name. More...
 
String walkmesh_name_
 The walkmesh file name. More...
 
Ogre::Real forward_direction_
 The forward direction. More...
 
PointList points_
 The list of entity points. More...
 
TriggerList triggers_
 The list of triggers. More...
 

Detailed Description

Handles map files.

Member Typedef Documentation

◆ Point

◆ PointList

typedef std::vector<Point> VGears::MapFile::PointList

◆ Trigger

◆ TriggerList

typedef std::vector<Trigger> VGears::MapFile::TriggerList

Constructor & Destructor Documentation

◆ MapFile()

VGears::MapFile::MapFile ( Ogre::ResourceManager *  creator,
const String name,
Ogre::ResourceHandle  handle,
const String group,
bool  is_manual = false,
Ogre::ManualResourceLoader *  loader = NULL 
)

Constructor.

Parameters
[in]creatorPointer to the ResourceManager that is creating this resource.
[in]nameThe unique name of the resource.
[in]handle
Todo:
Understand and document.
Parameters
[in]groupThe name of the resource group to which this resource belong.
[in]is_manualTrue if the resource is manually loaded, false otherwise.
[in]loaderPointer to a ManualResourceLoader implementation which will be called when the Resource wishes to load (should be supplied if is_manual is set to true). It can be null, but the Resource will never be able to reload if anything ever causes it to unload. Therefore provision of a proper ManualResourceLoader instance is strongly recommended.

◆ ~MapFile()

VGears::MapFile::~MapFile ( )
virtual

Destructor.

Member Function Documentation

◆ calculateSize()

size_t VGears::MapFile::calculateSize ( void  ) const
protectedvirtual

Calculates the size of the map.

It's the size of the tiles, script, walkmesh and forward direction.

Returns
The size of the map.

◆ GetBackground2dName()

const String & VGears::MapFile::GetBackground2dName ( ) const
virtual

Retrieves the map background file name.

Returns
The background file name.

◆ GetForwardDirection()

const Ogre::Real & VGears::MapFile::GetForwardDirection ( ) const
virtual

Retrieves the map forward direction.

The forward direction is the direction the playable character moves when 'up' is pressed.

Returns
The forward direction.

◆ GetPoints()

MapFile::PointList & VGears::MapFile::GetPoints ( )
virtual

Retrieves the list of entity points in the map.

Returns
The list of entity points in the map.

◆ GetScriptName()

const String & VGears::MapFile::GetScriptName ( ) const
virtual

Retrieves the map script name.

Returns
The script name.

◆ GetTextsName()

const String & VGears::MapFile::GetTextsName ( ) const
virtual

Retrieves the map texts file name.

Returns
The texts file name.

◆ GetTriggers()

MapFile::TriggerList & VGears::MapFile::GetTriggers ( )
virtual

Retrieves the map triggers.

Returns
The list of triggers.

◆ GetWalkmeshName()

const String & VGears::MapFile::GetWalkmeshName ( ) const
virtual

Retrieves the map walkmesh file name.

Returns
The walkmesh file name.

◆ loadImpl()

void VGears::MapFile::loadImpl ( void  )
overrideprotectedvirtual

Loads the file.

◆ SetBackground2dName()

void VGears::MapFile::SetBackground2dName ( const String background2d_name)
virtual

Sets the map background file name.

Parameters
[in]background2d_nameThe background file name.

◆ SetForwardDirection()

void VGears::MapFile::SetForwardDirection ( const Ogre::Real &  forward_direction)
virtual

Sets the map forward direction.

The forward direction is the direction the playable character moves when 'up' is pressed.

Parameters
[in]forward_directionThe forward direction.

◆ SetScriptName()

void VGears::MapFile::SetScriptName ( const String script_name)
virtual

Sets the map script name.

Parameters
[in]script_nameThe script name.

◆ SetTextsName()

void VGears::MapFile::SetTextsName ( const String texts_name)
virtual

Sets the map field texts file name.

Parameters
[in]texts_nameThe texts file name.

◆ SetWalkmeshName()

void VGears::MapFile::SetWalkmeshName ( const String walkmesh_name)
virtual

Sets the map walkmesh file name.

Parameters
[in]walkmesh_nameThe walkmesh file name.

◆ unloadImpl()

void VGears::MapFile::unloadImpl ( void  )
overrideprotectedvirtual

Unloads the file.

Member Data Documentation

◆ background_2d_name_

String VGears::MapFile::background_2d_name_
private

The background file name.

◆ forward_direction_

Ogre::Real VGears::MapFile::forward_direction_
private

The forward direction.

◆ points_

PointList VGears::MapFile::points_
private

The list of entity points.

◆ RESOURCE_TYPE

const String VGears::MapFile::RESOURCE_TYPE
static

The type of resource.

◆ script_name_

String VGears::MapFile::script_name_
private

The script file name.

◆ texts_name_

String VGears::MapFile::texts_name_
private

The background file name.

◆ triggers_

TriggerList VGears::MapFile::triggers_
private

The list of triggers.

◆ walkmesh_name_

String VGears::MapFile::walkmesh_name_
private

The walkmesh file name.


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