1
0
forked from 0ad/0ad
0ad/source/simulation/TechnologyCollection.h
Matei 845b606763 # Updates to the tech system, and bug fixes.
Techs: Made a separate list of technologies for every player, rather
than array fields in CTechnology. This also involved changing the
tech-related JS functions.

Bugs:
- PS_MAX_PLAYERS should be 8 (the way it's used for array sizes, etc
indicates that it's the maximum possible number of players ever, but it
used to be 6 while the game had 8 players).
- When you changed a CJSSharedProperty that was inherited, m_Inherited
was set to false, so it was no longer inherited by subsequent entities
you created. They got initialized to garbage values as a result.

This was SVN commit r4138.
2006-07-18 04:17:46 +00:00

31 lines
840 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 <vector>
#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:
~CTechnologyCollection();
CTechnology* getTechnology( CStrW techType, CPlayer* player );
int loadTechnologies();
void LoadFile( const char* path );
};
#endif