Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
orxonox::LevelInfoItem Class Reference

The LevelInfoItem class stores information regarding a Level and makes that information accessible through the LevelManager. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/orxonox/LevelInfo.h>

Inheritance diagram for orxonox::LevelInfoItem:
orxonox::OrxonoxInterface orxonox::Configurable orxonox::Destroyable orxonox::Listable orxonox::Identifiable orxonox::LevelInfo

Public Member Functions

 LevelInfoItem ()
 Default constructor. More...
 
 LevelInfoItem (const std::string &name, const std::string filename)
 Constructor. Initializes the object. More...
 
virtual ~LevelInfoItem ()
 Destructor. More...
 
bool addStartingShip (const std::string &ship, bool update=true)
 Add a model to shipselection. More...
 
bool addTag (const std::string &tag, bool update=true)
 Add a tag to the set of tags the Level is tagged with. More...
 
const std::string & getDescription () const
 Get the description of the Level. More...
 
const std::string & getName (void) const
 Get the name of the Level. More...
 
const std::string & getScreenshot () const
 Get the screenshot of the Level. More...
 
const std::string & getStartingShips (void) const
 Get the set of starting ship models the Level allows. More...
 
const std::string & getTags (void) const
 Get the lis of the tags the Level is tagged with. More...
 
const std::string & getXMLFilename (void) const
 Get the XML-filename of the Level. More...
 
bool hasStartingShip (const std::string &ship) const
 Get whether the Level allows a specific starting ship model. More...
 
bool hasTag (const std::string &tag) const
 Get whether the Level has a specific tag. More...
 
void selectStartingShip (const std::string &ship)
 
void setDescription (const std::string &description)
 Set the description of the Level. More...
 
void setName (const std::string &name)
 Set the name of the Level. More...
 
void setScreenshot (const std::string &screenshot)
 Set the screenshot of the Level. More...
 
void setStartingShips (const std::string &ships)
 Set the starting ship models of the level. More...
 
void setTags (const std::string &tags)
 Set the tags the Level is tagged with. More...
 
- Public Member Functions inherited from orxonox::OrxonoxInterface
 OrxonoxInterface ()
 
- Public Member Functions inherited from orxonox::Configurable
 Configurable ()
 
void setConfigValues ()
 Function to collect the SetConfigValue-macro calls. More...
 
- Public Member Functions inherited from orxonox::Listable
 Listable ()
 Constructor: Allocates space in the element list. More...
 
 Listable (Context *context)
 Constructor: Allocates space in the element list and assigns the context. More...
 
virtual ~Listable ()
 Destructor: Removes the object from the object-lists. More...
 
ContextgetContext () const
 
void setContext (Context *context)
 Changes the context. More...
 
void unregisterObject ()
 Removes this object from the object-lists. More...
 
- Public Member Functions inherited from orxonox::Identifiable
 Identifiable ()
 Constructor: Sets the default values. More...
 
virtual ~Identifiable ()
 
ORX_FORCEINLINE voidgetDerivedPointer (unsigned int classID)
 Returns a valid pointer of any derived type that is registered in the class hierarchy. More...
 
template<class T >
ORX_FORCEINLINE T * getDerivedPointer (unsigned int classID)
 Version of getDerivedPointer with template. More...
 
template<class T >
ORX_FORCEINLINE const T * getDerivedPointer (unsigned int classID) const
 Const version of getDerivedPointer with template. More...
 
IdentifiergetIdentifier () const
 Returns the Identifier of the object. More...
 
bool isA (const Identifier *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
template<class B >
bool isA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isA (const Identifiable *object)
 Returns true if the object's class is of the given type or a derivative. More...
 
bool isChildOf (const Identifier *identifier)
 Returns true if the object's class is a child of the given type. More...
 
template<class B >
bool isChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a child of the given type. More...
 
bool isChildOf (const Identifiable *object)
 Returns true if the object's class is a child of the given type. More...
 
bool isDirectChildOf (const Identifier *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
template<class B >
bool isDirectChildOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectChildOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isDirectParentOf (const Identifier *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
template<class B >
bool isDirectParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a direct parent of the given type. More...
 
bool isDirectParentOf (const Identifiable *object)
 Returns true if the object's class is a direct child of the given type. More...
 
bool isExactlyA (const Identifier *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
template<class B >
bool isExactlyA (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is exactly of the given type. More...
 
bool isExactlyA (const Identifiable *object)
 Returns true if the object's class is exactly of the given type. More...
 
bool isParentOf (const Identifier *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
template<class B >
bool isParentOf (const SubclassIdentifier< B > *identifier)
 Returns true if the object's class is a parent of the given type. More...
 
bool isParentOf (const Identifiable *object)
 Returns true if the object's class is a parent of the given type. More...
 
- Public Member Functions inherited from orxonox::Destroyable
 Destroyable ()
 Constructor: Sets the default values. More...
 
virtual ~Destroyable ()
 Destructor: Notifies all DestructionListener (for example weak pointers) that this object is being deleted. More...
 
void destroy ()
 Deletes the object if no strong pointers point to this object. More...
 
void destroyLater ()
 Works like destroy() but doesn't destroy the object until the current tick has ended. More...
 
unsigned int getReferenceCount () const
 Returns the number of strong pointers that point to this object. More...
 

Protected Member Functions

void setXMLFilename (const std::string &filename)
 Set the XML-filename of the Level. More...
 
- Protected Member Functions inherited from orxonox::Destroyable
virtual void preDestroy ()
 This virtual function is called if destroy() is called and no StrongPtr points to this object. More...
 

Protected Attributes

std::string xmlfilename_
 The XML-filename of the Level. More...
 

Private Member Functions

void changeStartingShip (const std::string &model)
 
void startingshipsUpdated (void)
 Updates the comma-seperated string of all possible starting ships. More...
 
void tagsUpdated (void)
 Updates the comma-seperated string of all tags, if the set of tags has changed. More...
 

Static Private Member Functions

static void initializeTags (void)
 Initialize the set of allowed tags. More...
 
static bool validateTag (const std::string &tag)
 Check whether an input tag is allowed. More...
 

Private Attributes

std::string description_
 The description of the Level. More...
 
std::string name_
 The name of the Level. More...
 
std::string screenshot_
 The screenshot of the Level. More...
 
std::set< std::string > startingShips_
 The set of starting ship models the Level allows. More...
 
std::string startingShipsString_
 The comma-seperated string of all the allowed ship models for the shipselection. More...
 
std::set< std::string > tags_
 The set of tags the Level is tagged with. More...
 
std::string tagsString_
 The comma-seperated string of all the tags the Level is tagged with. More...
 

Static Private Attributes

static const bool initialized_s = false
 Whether the set of allowed tags has been inizialized. More...
 
static std::set< std::string > possibleTags_s = std::set<std::string>()
 The set of allowed tags. More...
 

Detailed Description

The LevelInfoItem class stores information regarding a Level and makes that information accessible through the LevelManager.

A LevelInfoItem object is commonly created from a LevelInfo object, using its copy() method.

Author
Damian 'Mozork' Frick

Constructor & Destructor Documentation

orxonox::LevelInfoItem::LevelInfoItem ( )

Default constructor.

orxonox::LevelInfoItem::LevelInfoItem ( const std::string &  name,
const std::string  filename 
)

Constructor. Initializes the object.

Constructor.

Initializes the object.

Parameters
nameThe name of the Level.
filenameThe XML-filename of the Level.
orxonox::LevelInfoItem::~LevelInfoItem ( )
virtual

Destructor.

Member Function Documentation

bool orxonox::LevelInfoItem::addStartingShip ( const std::string &  ship,
bool  update = true 
)

Add a model to shipselection.

Add a ship model to allowed models for the shipselection.

Parameters
shipThe ship model to be added.
updateWhether the comma-seperated string of all ship models should be updated. Default is true.
Returns
Returns true if the ship was successfully added, if the ship was already present it returns false.
bool orxonox::LevelInfoItem::addTag ( const std::string &  tag,
bool  update = true 
)

Add a tag to the set of tags the Level is tagged with.

Parameters
tagThe tag to be added.
updateWhether the comma-seperated string of all tags should be updated. Default is true.
Returns
Returns true if the tag was successfully added, if the tag was already present it returns false.
void orxonox::LevelInfoItem::changeStartingShip ( const std::string &  model)
private
const std::string& orxonox::LevelInfoItem::getDescription ( void  ) const
inline

Get the description of the Level.

Returns
Returns the description of the Level.
const std::string& orxonox::LevelInfoItem::getName ( void  ) const
inline

Get the name of the Level.

Returns
Returns the name of the Level.
const std::string& orxonox::LevelInfoItem::getScreenshot ( ) const
inline

Get the screenshot of the Level.

Returns
Returns the screenshot of the Level.
const std::string& orxonox::LevelInfoItem::getStartingShips ( void  ) const
inline

Get the set of starting ship models the Level allows.

Returns
Returns a comma-seperated string of all the allowed ship models for the shipselection.
const std::string& orxonox::LevelInfoItem::getTags ( void  ) const
inline

Get the lis of the tags the Level is tagged with.

Returns
Returns a comma-seperated string of all the tags the Level is tagged with.
const std::string& orxonox::LevelInfoItem::getXMLFilename ( void  ) const
inline

Get the XML-filename of the Level.

Returns
Returns the XML-filename (including *.oxw extension) of the Level.
bool orxonox::LevelInfoItem::hasStartingShip ( const std::string &  ship) const
inline

Get whether the Level allows a specific starting ship model.

Parameters
shipThe ship model for which is checked.
Returns
Returns true if the Level allows the input ship model
bool orxonox::LevelInfoItem::hasTag ( const std::string &  tag) const
inline

Get whether the Level has a specific tag.

Parameters
tagThe tag for which is checked.
Returns
Returns true if the Level is tagged with the input tag.
void orxonox::LevelInfoItem::initializeTags ( void  )
staticprivate

Initialize the set of allowed tags.

void orxonox::LevelInfoItem::selectStartingShip ( const std::string &  ship)
inline
void orxonox::LevelInfoItem::setDescription ( const std::string &  description)
inline

Set the description of the Level.

Parameters
descriptionThe description to be set.
void orxonox::LevelInfoItem::setName ( const std::string &  name)
inline

Set the name of the Level.

Parameters
nameThe name to be set.
void orxonox::LevelInfoItem::setScreenshot ( const std::string &  screenshot)
inline

Set the screenshot of the Level.

Parameters
screenshotThe screenshot to be set.
void orxonox::LevelInfoItem::setStartingShips ( const std::string &  ships)

Set the starting ship models of the level.

Parameters
shipsA comma-seperated string of all the allowed ship models for the shipselection.
void orxonox::LevelInfoItem::setTags ( const std::string &  tags)

Set the tags the Level is tagged with.

Parameters
tagsA comma-seperated string of all the tags to be set.
void orxonox::LevelInfoItem::setXMLFilename ( const std::string &  filename)
inlineprotected

Set the XML-filename of the Level.

Parameters
filenameThe XML-filename to be set.
void orxonox::LevelInfoItem::startingshipsUpdated ( void  )
private

Updates the comma-seperated string of all possible starting ships.

Updates the comma-seperated string of all ships, if the set of tags has changed.

void orxonox::LevelInfoItem::tagsUpdated ( void  )
private

Updates the comma-seperated string of all tags, if the set of tags has changed.

static bool orxonox::LevelInfoItem::validateTag ( const std::string &  tag)
inlinestaticprivate

Check whether an input tag is allowed.

Parameters
tagThe tag to check.
Returns
Returns true if the input tag is allowed, false if not.

Member Data Documentation

std::string orxonox::LevelInfoItem::description_
private

The description of the Level.

const bool orxonox::LevelInfoItem::initialized_s = false
staticprivate

Whether the set of allowed tags has been inizialized.

std::string orxonox::LevelInfoItem::name_
private

The name of the Level.

std::set< std::string > orxonox::LevelInfoItem::possibleTags_s = std::set<std::string>()
staticprivate

The set of allowed tags.

The list of allowed tags.

std::string orxonox::LevelInfoItem::screenshot_
private

The screenshot of the Level.

std::set<std::string> orxonox::LevelInfoItem::startingShips_
private

The set of starting ship models the Level allows.

std::string orxonox::LevelInfoItem::startingShipsString_
private

The comma-seperated string of all the allowed ship models for the shipselection.

std::set<std::string> orxonox::LevelInfoItem::tags_
private

The set of tags the Level is tagged with.

std::string orxonox::LevelInfoItem::tagsString_
private

The comma-seperated string of all the tags the Level is tagged with.

std::string orxonox::LevelInfoItem::xmlfilename_
protected

The XML-filename of the Level.


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