PageRenderTime 11ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/TGame/TCommon/Gene/GeneFactoryImp.cpp

http://awoe.googlecode.com/
C++ | 51 lines | 43 code | 8 blank | 0 comment | 1 complexity | d0a9de6fad487277a870758a42117d7c MD5 | raw file
 1#include "stdafx.h"
 2#include "GeneFactoryImp.h"
 3#include "GeneS.h"
 4#include "GeneE.h"
 5
 6#include "Status/GEBlind.h"
 7#include "Status/GECharm.h"
 8#include "Status/GEConfuse.h"
 9#include "Status/GEDaze.h"
10#include "Status/GEDefeated.h"
11#include "Status/GEDOT.h"
12#include "Status/GEDrain.h"
13#include "Status/GEFear.h"
14#include "Status/GEHaste.h"
15#include "Status/GEHOT.h"
16#include "Status/GEInvisibility.h"
17#include "Status/GEModifier.h"
18#include "Status/GEStance.h"
19#include "Status/GEShield.h"
20#include "Status/GESlow.h"
21#include "Status/GESnare.h"
22#include "Status/GEStateAES.h"
23
24
25GeneFactoryImp::GeneFactoryImp()
26{
27
28}
29
30GeneFactoryImp::~GeneFactoryImp()
31{
32
33}
34
35void
36GeneFactoryImp::initialize()
37{
38	registerGene<GEBlind>(1000);
39	registerGene<GECharm>(10001);
40}
41
42IGene*
43GeneFactoryImp::create(IGeneCreateData& createData )
44{
45	GeneClass2Creator::iterator it = m_theCreators.find(createData.getClass());
46	if (it!=m_theCreators.end())
47	{
48		return it->second->create();
49	}
50	return NULL;
51}