equal
deleted
inserted
replaced
28 /** |
28 /** |
29 * This registers your AI to the main system so we know about you. |
29 * This registers your AI to the main system so we know about you. |
30 */ |
30 */ |
31 void RegisterFactory(const char *name) |
31 void RegisterFactory(const char *name) |
32 { |
32 { |
33 this->name = name; |
|
34 /* Don't register nameless Factories */ |
33 /* Don't register nameless Factories */ |
35 if (name == NULL) return; |
34 if (name == NULL) return; |
36 |
35 |
|
36 this->name = name; |
37 std::pair<Factories::iterator, bool> P = GetFactories().insert(Factories::value_type(name, this)); |
37 std::pair<Factories::iterator, bool> P = GetFactories().insert(Factories::value_type(name, this)); |
38 assert(P.second); |
38 assert(P.second); |
39 } |
39 } |
40 |
40 |
41 public: |
41 public: |
|
42 AIFactoryBase() : |
|
43 name(NULL) |
|
44 {} |
42 virtual ~AIFactoryBase() { if (this->name != NULL) GetFactories().erase(this->name); } |
45 virtual ~AIFactoryBase() { if (this->name != NULL) GetFactories().erase(this->name); } |
43 |
46 |
44 /** |
47 /** |
45 * Run all initializers. |
48 * Run all initializers. |
46 */ |
49 */ |