#include <map.h>
Public Types | ||||
| enum | PlaceableFilter { Placeable, NotPlaceable, Either } | |||
Public Member Functions | ||||
| const std::string & | GetName () const | |||
| ||||
| const std::string & | GetSavedName () const | |||
| ||||
| void | SetName (const std::string &newName) | |||
| Sets the maps mName. | ||||
| const std::string & | GetFileName () const | |||
| ||||
| const std::string & | GetDescription () const | |||
| ||||
| void | SetDescription (const std::string &newDescription) | |||
| Sets the description text. | ||||
| const std::string & | GetAuthor () const | |||
| ||||
| void | SetAuthor (const std::string &newAuthor) | |||
| Sets the map's author. | ||||
| const std::string & | GetPathNodeFileName () const | |||
| ||||
| void | SetPathNodeFileName (const std::string &newFilename) | |||
| Sets the name of the file used for loading and saving pathnodes. | ||||
| bool | GetCreateNavMesh () const | |||
| ||||
| void | SetCreateNavMesh (bool pNavMesh) | |||
| Sets whether or not we create a NavMesh on save used with waypoints. | ||||
| const std::string & | GetComment () const | |||
| ||||
| void | SetComment (const std::string &newComment) | |||
| Sets the comments. | ||||
| const std::string & | GetCopyright () const | |||
| ||||
| void | SetCopyright (const std::string &newCopyright) | |||
| Sets the copyright information. | ||||
| const std::string & | GetCreateDateTime () const | |||
| ||||
| void | SetCreateDateTime (const std::string &newCreateDateTime) | |||
| Sets the create date time for map based on the first time it was saved. | ||||
| ActorProxy * | GetProxyById (const dtCore::UniqueId &id) | |||
| Searches all open maps to find the proxy with the given unique id. | ||||
| template<typename ProxyType> | ||||
| void | GetProxyById (const dtCore::UniqueId &id, ProxyType *&proxy) | |||
| Templated version of GetProxyById that takes a pointer to the desired type and assigns it by dynamic casting to the that type. | ||||
| const ActorProxy * | GetProxyById (const dtCore::UniqueId &id) const | |||
| Searches all open maps to find the proxy with the given unique id. | ||||
| template<typename ProxyType> | ||||
| void | GetProxyById (const dtCore::UniqueId &id, const ProxyType *&proxy) const | |||
| Templated version of GetProxyById that takes a pointer to the desired type and assigns it by dynamic casting to the that type. | ||||
| void | FindProxies (std::vector< dtCore::RefPtr< ActorProxy > > &container, const std::string &name, const std::string &category=std::string(""), const std::string &typeName=std::string(""), const std::string &className=std::string(""), PlaceableFilter placeable=Either) | |||
| non-const search for proxies. | ||||
| void | FindProxies (std::vector< dtCore::RefPtr< const ActorProxy > > &container, const std::string &name, const std::string &category=std::string(""), const std::string &typeName=std::string(""), const std::string &className=std::string(""), PlaceableFilter placeable=Either) const | |||
| Const version of find for methods that may need to find a proxy only to read values. | ||||
| const std::map < dtCore::UniqueId, dtCore::RefPtr< ActorProxy > > & | GetAllProxies () const | |||
| ||||
| void | GetAllProxies (std::vector< dtCore::RefPtr< ActorProxy > > &container) | |||
| ||||
| void | AddProxy (ActorProxy &proxy) | |||
| Adds a new proxy to the map. | ||||
| bool | RemoveProxy (const ActorProxy &proxy) | |||
| Removes a proxy. | ||||
| void | ClearProxies () | |||
| Clear all the proxies from the map. | ||||
| const std::set< std::string > & | GetProxyActorClasses () const | |||
| ||||
| void | RebuildProxyActorClassSet () const | |||
| rebuilds the list of classes of the actor proxies since items are not removed when proxies are not removed. | ||||
| bool | IsModified () const | |||
| ||||
| void | SetModified (bool val) | |||
| Sets the map modified status. | ||||
| bool | HasLoadingErrors () | |||
| const std::vector< std::string > & | GetMissingLibraries () | |||
| const std::set< std::string > & | GetMissingActorTypes () | |||
| const std::map< std::string, std::string > & | GetLibraryVersionMap () const | |||
| ||||
| const std::vector< std::string > & | GetAllLibraries () const | |||
| ||||
| bool | HasLibrary (const std::string &mName) const | |||
| ||||
| const std::string | GetLibraryVersion (const std::string &mName) const | |||
| ||||
| void | InsertLibrary (unsigned pos, const std::string &mName, const std::string &version) | |||
| Inserts a library with the given mName at the given position. | ||||
| void | AddLibrary (const std::string &mName, const std::string &version) | |||
| This will add the given library to the map. | ||||
| bool | RemoveLibrary (const std::string &mName) | |||
| Removes a library by mName. | ||||
| Map (const std::string &filemName, const std::string &mName=std::string("")) | ||||
| Creates a new map. | ||||
| ActorProxy * | GetEnvironmentActor () | |||
| Returns the environment actor of this map or NULL if no environment is set. | ||||
| const ActorProxy * | GetEnvironmentActor () const | |||
| const version of the above function Returns the environment actor of this map or NULL if no environment is set | ||||
| GameEventManager & | GetEventManager () | |||
| ||||
| const GameEventManager & | GetEventManager () const | |||
| ||||
| void | SetEnvironmentActor (ActorProxy *envActor) | |||
| Sets the environment actor on this map. | ||||
Static Public Member Functions | ||||
| static bool | WildMatch (const std::string &sWild, const std::string &sString) | |||
| Matches a string against wildcard string. | ||||
Static Public Attributes | ||||
| static const std::string | MAP_FILE_EXTENSION | |||
Protected Member Functions | ||||
| void | SetFileName (const std::string &newFileName) | |||
| Assigns the file name this map should be saved to. | ||||
| void | SetSavedName (const std::string &newSavedName) | |||
| Assigns the saved map name. | ||||
| void | ClearModified () | |||
| Clears the modified flag on this map and clears the lists of missing libraries and actor types. | ||||
| void | AddMissingLibraries (const std::vector< std::string > &libs) | |||
| Adds a vector of library mNames to the list of libraries that could not be loaded when this map was read from a save file. | ||||
| void | AddMissingActorTypes (const std::set< std::string > &types) | |||
| Adds a set of actor types to the set of types that could not be created when this map was loaded from a save file. | ||||
| virtual | ~Map () | |||
Friends | ||||
| class | Project | |||
Classes | ||||
| class | MapGameEvents | |||
| dtDAL::Map::Map | ( | const std::string & | filemName, | |
| const std::string & | mName = std::string("") | |||
| ) |
Creates a new map.
| filemName | the filemName to use to save the map. If the extension is left off, it will be added. | |
| mName | the mName to give the map. |
| dtDAL::Map::~Map | ( | ) | [protected, virtual] |
| const std::string& dtDAL::Map::GetName | ( | ) | const [inline] |
| const std::string& dtDAL::Map::GetSavedName | ( | ) | const [inline] |
| void dtDAL::Map::SetName | ( | const std::string & | newName | ) | [inline] |
Sets the maps mName.
| newmName | the mName to assign |
| const std::string& dtDAL::Map::GetFileName | ( | ) | const [inline] |
| const std::string& dtDAL::Map::GetDescription | ( | ) | const [inline] |
This is intended to be a short description.
| void dtDAL::Map::SetDescription | ( | const std::string & | newDescription | ) | [inline] |
Sets the description text.
| newDescription | the new text. |
| const std::string& dtDAL::Map::GetAuthor | ( | ) | const [inline] |
| void dtDAL::Map::SetAuthor | ( | const std::string & | newAuthor | ) | [inline] |
Sets the map's author.
| newAuthor | the author's mName. |
| const std::string& dtDAL::Map::GetPathNodeFileName | ( | ) | const [inline] |
| void dtDAL::Map::SetPathNodeFileName | ( | const std::string & | newFilename | ) | [inline] |
Sets the name of the file used for loading and saving pathnodes.
| newFilename | the new filename. |
| bool dtDAL::Map::GetCreateNavMesh | ( | ) | const [inline] |
| void dtDAL::Map::SetCreateNavMesh | ( | bool | pNavMesh | ) | [inline] |
Sets whether or not we create a NavMesh on save used with waypoints.
| const std::string& dtDAL::Map::GetComment | ( | ) | const [inline] |
This is intended to be the long comments.
| void dtDAL::Map::SetComment | ( | const std::string & | newComment | ) | [inline] |
Sets the comments.
| newComment | the new comment text. |
| const std::string& dtDAL::Map::GetCopyright | ( | ) | const [inline] |
| void dtDAL::Map::SetCopyright | ( | const std::string & | newCopyright | ) | [inline] |
Sets the copyright information.
| newCopyright | the new copyright information. |
| const std::string& dtDAL::Map::GetCreateDateTime | ( | ) | const [inline] |
| void dtDAL::Map::SetCreateDateTime | ( | const std::string & | newCreateDateTime | ) | [inline] |
Sets the create date time for map based on the first time it was saved.
The value is not validated, but it is expected to be a UTC formatted string.
| newCreateDateTime | the new create date time value. |
| ActorProxy * dtDAL::Map::GetProxyById | ( | const dtCore::UniqueId & | id | ) |
Searches all open maps to find the proxy with the given unique id.
| id | the id of the proxy to return. |
| void dtDAL::Map::GetProxyById | ( | const dtCore::UniqueId & | id, | |
| ProxyType *& | proxy | |||
| ) | [inline] |
Templated version of GetProxyById that takes a pointer to the desired type and assigns it by dynamic casting to the that type.
| id | the id of the actor to find. | |
| proxy | Output Parametr. A pointer to a proxy by reference. |
| const ActorProxy * dtDAL::Map::GetProxyById | ( | const dtCore::UniqueId & | id | ) | const |
Searches all open maps to find the proxy with the given unique id.
| id | the id of the proxy to return. |
| void dtDAL::Map::GetProxyById | ( | const dtCore::UniqueId & | id, | |
| const ProxyType *& | proxy | |||
| ) | const [inline] |
Templated version of GetProxyById that takes a pointer to the desired type and assigns it by dynamic casting to the that type.
| id | the id of the actor to find. | |
| proxy | Output Parametr. A pointer to a proxy by reference. |
| void dtDAL::Map::FindProxies | ( | std::vector< dtCore::RefPtr< ActorProxy > > & | container, | |
| const std::string & | name, | |||
| const std::string & | category = std::string(""), |
|||
| const std::string & | typeName = std::string(""), |
|||
| const std::string & | className = std::string(""), |
|||
| PlaceableFilter | placeable = Either | |||
| ) |
non-const search for proxies.
| container | The container to fill. | |
| name | The name of the proxy to find or empty string to not use the name. | |
| category | The category of the proxy to find, this will also find proxies in subcategories. Use empty string to ignore. | |
| typeName | The name of the proxy actor type. Use empty string or omit the parameter to ignore the type. | |
| className | The name of the actor class to match. It will match this as a superclass. | |
| placeable | set to Placeable to search for only proxys that return true for isPlaceable, NonPlaceable for false, or Either for both. |
| void dtDAL::Map::FindProxies | ( | std::vector< dtCore::RefPtr< const ActorProxy > > & | container, | |
| const std::string & | name, | |||
| const std::string & | category = std::string(""), |
|||
| const std::string & | typeName = std::string(""), |
|||
| const std::string & | className = std::string(""), |
|||
| PlaceableFilter | placeable = Either | |||
| ) | const |
Const version of find for methods that may need to find a proxy only to read values.
| container | The container to fill, note that it holds const ActorProxy. | |
| name | The name of the proxy to find or empty string to not use the name. | |
| category | The category of the proxy to find, this will also find proxies in subcategories. Use empty string to ignore. | |
| typeName | The name of the proxy actor type. Use empty string or omit the parameter to ignore the type. | |
| className | The name of the actor class to match. It will match this as a superclass. | |
| placeable | set to Placeable to search for only proxys that return true for isPlaceable, NonPlaceable for false, or Either for both. |
| const std::map<dtCore::UniqueId, dtCore::RefPtr<ActorProxy> >& dtDAL::Map::GetAllProxies | ( | ) | const [inline] |
| void dtDAL::Map::GetAllProxies | ( | std::vector< dtCore::RefPtr< ActorProxy > > & | container | ) | [inline] |
| void dtDAL::Map::AddProxy | ( | ActorProxy & | proxy | ) |
Adds a new proxy to the map.
| proxy | the proxy to add. |
| bool dtDAL::Map::RemoveProxy | ( | const ActorProxy & | proxy | ) |
Removes a proxy.
| proxy | the proxy to remove. |
| void dtDAL::Map::ClearProxies | ( | ) |
Clear all the proxies from the map.
| const std::set<std::string>& dtDAL::Map::GetProxyActorClasses | ( | ) | const [inline] |
| void dtDAL::Map::RebuildProxyActorClassSet | ( | ) | const |
rebuilds the list of classes of the actor proxies since items are not removed when proxies are not removed.
Call this after a large number of proxies has been removed.
| bool dtDAL::Map::IsModified | ( | ) | const [inline] |
| void dtDAL::Map::SetModified | ( | bool | val | ) | [inline] |
Sets the map modified status.
| val | True modified, false otherwise. |
| bool dtDAL::Map::HasLoadingErrors | ( | ) | [inline] |
| const std::vector<std::string>& dtDAL::Map::GetMissingLibraries | ( | ) | [inline] |
| const std::set<std::string>& dtDAL::Map::GetMissingActorTypes | ( | ) | [inline] |
| const std::map<std::string, std::string>& dtDAL::Map::GetLibraryVersionMap | ( | ) | const [inline] |
These are the libraries the map depends on.
| const std::vector<std::string>& dtDAL::Map::GetAllLibraries | ( | ) | const [inline] |
| bool dtDAL::Map::HasLibrary | ( | const std::string & | mName | ) | const [inline] |
| mName | the mName of the library. |
| const std::string dtDAL::Map::GetLibraryVersion | ( | const std::string & | mName | ) | const [inline] |
| mName | the mName of the library to query. |
| void dtDAL::Map::InsertLibrary | ( | unsigned | pos, | |
| const std::string & | mName, | |||
| const std::string & | version | |||
| ) |
Inserts a library with the given mName at the given position.
If a library of the given mName is already in the map, the version will be updated and the order adjusted to match the iterator.
| pos | the position to place the library. | |
| mName | the mName of the library | |
| version | the version string of the library. |
| void dtDAL::Map::AddLibrary | ( | const std::string & | mName, | |
| const std::string & | version | |||
| ) |
This will add the given library to the map.
If a library by the given mName is already in the map, the library will be placed at the end and the version will be update to the one given.
| mName | the mName of the library. | |
| version | the version string of the library. |
| bool dtDAL::Map::RemoveLibrary | ( | const std::string & | mName | ) |
Removes a library by mName.
| mName | the mName of the library to remove. |
| bool dtDAL::Map::WildMatch | ( | const std::string & | sWild, | |
| const std::string & | sString | |||
| ) | [static] |
Matches a string against wildcard string.
"*" matches anything. "?" matches any single character.
| sWild | the string with wildcards to match with. | |
| sString | the string to check. |
| ActorProxy* dtDAL::Map::GetEnvironmentActor | ( | ) | [inline] |
Returns the environment actor of this map or NULL if no environment is set.
| const ActorProxy* dtDAL::Map::GetEnvironmentActor | ( | ) | const [inline] |
const version of the above function Returns the environment actor of this map or NULL if no environment is set
| GameEventManager & dtDAL::Map::GetEventManager | ( | ) |
| const GameEventManager & dtDAL::Map::GetEventManager | ( | ) | const |
| void dtDAL::Map::SetEnvironmentActor | ( | ActorProxy * | envActor | ) |
Sets the environment actor on this map.
| envActor | The new environment actor to set |
| void dtDAL::Map::SetFileName | ( | const std::string & | newFileName | ) | [protected] |
Assigns the file name this map should be saved to.
It should not have an extension.
| newFileName | the new file name. |
| void dtDAL::Map::SetSavedName | ( | const std::string & | newSavedName | ) | [inline, protected] |
Assigns the saved map name.
This is used as an override when loading backup copies of maps since they may have had the name changed and need this set.
| newSavedname | the new file name. |
| void dtDAL::Map::ClearModified | ( | ) | [protected] |
Clears the modified flag on this map and clears the lists of missing libraries and actor types.
| void dtDAL::Map::AddMissingLibraries | ( | const std::vector< std::string > & | libs | ) | [protected] |
Adds a vector of library mNames to the list of libraries that could not be loaded when this map was read from a save file.
| libs | the libraries to add. |
| void dtDAL::Map::AddMissingActorTypes | ( | const std::set< std::string > & | types | ) | [protected] |
Adds a set of actor types to the set of types that could not be created when this map was loaded from a save file.
| types | the types to add. |
friend class Project [friend] |
const std::string dtDAL::Map::MAP_FILE_EXTENSION [static] |