Game Develop Core: gd::Resource Class Reference

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
Public Member Functions | List of all members
gd::Resource Class Reference

Base class to describe a resource used by a game. More...

`#include <ResourcesManager.h>`

Inheritance diagram for gd::Resource:
[legend]

## Public Member Functions

virtual Resource * | Clone () const
virtual void | SetName (const std::string &name_)
| Change the name of the resource with the name passed as parameter.
virtual const std::string & | GetName () const
| Return the name of the resource.
virtual void | SetKind (const std::string &newKind)
| Change the kind of the resource.
virtual const std::string & | GetKind () const
| Return the name of the object.
virtual void | SetUserAdded (bool isUserAdded)
| Change if the resource is user added or not.
virtual bool | IsUserAdded () const
| Return true if the resource was added by the user.
virtual bool | UseFile ()
| Return true if the resource use a file. More...
virtual std::string & | GetFile ()
| Return, if applicable, a reference to the string containing the file used by the resource. The file is relative to the project directory. More...
virtual const std::string & | GetFile () const
| Return, if applicable, a reference to the string containing the file used by the resource. The file is relative to the project directory. More...
std::string | GetAbsoluteFile (const gd::Project &game) const
| Return, if applicable, a string containing the absolute filename of the resource.
virtual bool | EditProperty (gd::Project &project, const std::string &property)
| Called when a property must be edited ( i.e: it was double clicked ) More...
virtual bool | ChangeProperty (gd::Project &project, const std::string &property, const std::string &newValue)
| Called when a property must be changed ( i.e: its value was changed in the property grid ) More...
virtual void | GetPropertyInformation (gd::Project &project, const std::string &property, std::string &userFriendlyName, std::string &description) const
| Must return a description of the main property provided by the resource ( Example : "Image file" )
virtual std::string | GetProperty (gd::Project &project, const std::string &property)
| Called when a property must be changed ( i.e: its value was changed in the property grid ) More...
virtual std::vector< std::string > | GetAllProperties (gd::Project &project) const
| Return a description of the main property provided by the resource ( Example : "Image file" )
virtual void | RenderPreview (wxPaintDC &dc, wxPanel &previewPanel, gd::Project &game)
| Called when the resource must be rendered in a preview panel.
virtual void | LoadFromXml (const TiXmlElement *elem)
| Load from an xml element.
virtual void | SaveToXml (TiXmlElement *elem) const
| Save to an xml element.

## Detailed Description

Base class to describe a resource used by a game.

## Member Function Documentation

virtual bool gd::Resource::ChangeProperty | ( | gd::Project & | project,
|  | const std::string & | property,
|  | const std::string & | newValue
| ) |  |

inlinevirtual

Called when a property must be changed ( i.e: its value was changed in the property grid )

Returns
  true if the resource was changed

Reimplemented in gd::ImageResource.

virtual bool gd::Resource::EditProperty | ( | gd::Project & | project,
|  | const std::string & | property
| ) |  |

inlinevirtual

Called when a property must be edited ( i.e: it was double clicked )

Returns
  true if the resource was changed

Reimplemented in gd::ImageResource.

virtual std::string& gd::Resource::GetFile | ( | ) |  |

inlinevirtual

Return, if applicable, a reference to the string containing the file used by the resource. The file is relative to the project directory.

See Also
  UseFile

Reimplemented in gd::ImageResource.

virtual const std::string& gd::Resource::GetFile | ( | ) |  | const

inlinevirtual

Return, if applicable, a reference to the string containing the file used by the resource. The file is relative to the project directory.

See Also
  UseFile

Reimplemented in gd::ImageResource.

virtual std::string gd::Resource::GetProperty | ( | gd::Project & | project,
|  | const std::string & | property
| ) |  |

inlinevirtual

Called when a property must be changed ( i.e: its value was changed in the property grid )

Returns
  the value of the property

Reimplemented in gd::ImageResource.

virtual bool gd::Resource::UseFile | ( | ) |  |

inlinevirtual

Return true if the resource use a file.

See Also
  GetFile

Reimplemented in gd::ImageResource.

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

- ResourcesManager.h
- ResourcesManager.cpp