0ad/source/simulation/TechnologyCollection.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

34 lines
893 B
C++

//Andrew aka pyrolink - ajdecker1022@msn.com
//Manages the tech templates. More detail: see CFormation and CEntityTemplate (collections)
#ifndef TECHNOLOGY_COLLECTION_INCLUDED
#define TECHNOLOGY_COLLECTION_INCLUDED
#include "ps/CStr.h"
#include "ps/Singleton.h"
#include "Technology.h"
#include "ps/Game.h"
#define g_TechnologyCollection CTechnologyCollection::GetSingleton()
class CTechnologyCollection : public Singleton<CTechnologyCollection>
{
typedef std::map<CStrW, CTechnology*> TechMap;
typedef std::map<CStrW, CStr> TechFilenameMap;
TechMap m_techs[PS_MAX_PLAYERS+1];
TechFilenameMap m_techFilenames;
public:
std::vector<CTechnology*> activeTechs[PS_MAX_PLAYERS+1];
CTechnology* getTechnology( const CStrW& techType, CPlayer* player );
~CTechnologyCollection();
int loadTechnologies();
void LoadFile( const char* path );
};
#endif