Changeset 6239 in orxonox.OLD for branches/network/src/util
- Timestamp:
- Dec 21, 2005, 3:29:38 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/util/loading/factory.cc
r5984 r6239 127 127 } 128 128 129 BaseObject* Factory::fabricate(ClassID classID) 130 { 131 if (Factory::factoryList == NULL) 132 return NULL; 133 134 std::list<Factory*>::const_iterator factory; 135 for (factory = Factory::factoryList->begin(); factory != Factory::factoryList->end(); factory++) 136 if (*(*factory) == classID) 137 break; 138 139 if (factory != Factory::factoryList->end()) 140 { 141 PRINTF(4)("Create a new Object of type %s\n", (*factory)->getName()); 142 return (*factory)->fabricateObject(NULL); 143 } 144 else 145 { 146 PRINTF(2)("Could not Fabricate an Object of ClassID '%h'\n", classID); 147 return NULL; 148 } 149 } 150 129 151 130 152 /** … … 160 182 * @returns a new Object of Type classID on match, NULL otherwise 161 183 */ 162 BaseObject* Factory::fabricate(ClassID classID)163 {164 if (Factory::factoryList == NULL)165 return NULL;166 184 167 std::list<Factory*>::const_iterator factory;168 for (factory = Factory::factoryList->begin(); factory != Factory::factoryList->end(); factory++)169 if (*(*factory) == classID)170 break;171 172 if (factory != Factory::factoryList->end())173 {174 PRINTF(4)("Create a new Object of type %s\n", (*factory)->getName());175 return (*factory)->fabricateObject(NULL);176 }177 else178 {179 PRINTF(2)("Could not Fabricate an Object of ClassID '%h'\n", classID);180 return NULL;181 }182 }
Note: See TracChangeset
for help on using the changeset viewer.