0ad/source/simulation/FormationCollection.h
janwas c817566222 # housekeeping
replaced all (*) CStr / CStrW by-value params with const reference. hoo
boy.

please always perform this optimization (actually standard idiom) when
writing the code - it takes little work, tells the next guy that the
string won't be modified, and makes a large performance difference.

(* where possible.. a few require other changes and will follow later)

This was SVN commit r4151.
2006-07-20 14:37:58 +00:00

38 lines
1.0 KiB
C++

//FormationCollection.h
//Andrew aka pyrolink: ajdecker1022@msn.com
//Nearly identical to EntityTemplateCollection and associates i.e. EntityTemplate, Entity.
//This is the manager of the entity formation "templates"
#ifndef FORMATION_COLLECTION_INCLUDED
#define FORMATION_COLLECTION_INCLUDED
#include <vector>
#include "ps/CStr.h"
#include "ps/Singleton.h"
#include "Formation.h"
#define g_EntityFormationCollection CFormationCollection::GetSingleton()
class CFormationCollection : public Singleton<CFormationCollection>
{
typedef std::map<CStrW, CFormation*> templateMap;
typedef std::map<CStrW, CStr> templateFilenameMap;
templateMap m_templates;
templateFilenameMap m_templateFilenames;
public:
~CFormationCollection();
CFormation* getTemplate( const CStrW& formationType );
int loadTemplates();
void LoadFile( const char* path );
// Create a list of the names of all base entities, excluding template_*,
// for display in ScEd's entity-selection box.
void getFormationNames( std::vector<CStrW>& names );
};
#endif