| 190 | } |
| 191 | |
| 192 | void ConsoleConstructor::validate() |
| 193 | { |
| 194 | #ifdef TORQUE_DEBUG |
| 195 | // Don't do the following check if we're not a method/func. |
| 196 | if(this->group) |
| 197 | return; |
| 198 | |
| 199 | // In debug, walk the list and make sure this isn't a duplicate. |
| 200 | for(ConsoleConstructor *walk = first; walk; walk = walk->next) |
| 201 | { |
| 202 | // Skip mismatching func/method names. |
| 203 | if(dStricmp(walk->funcName, this->funcName)) |
| 204 | continue; |
| 205 | |
| 206 | // Don't compare functions with methods or vice versa. |
| 207 | if(bool(this->className) != bool(walk->className)) |
| 208 | continue; |
| 209 | |
| 210 | // Skip mismatching classnames, if they're present. |
| 211 | if(this->className && walk->className && dStricmp(walk->className, this->className)) |
| 212 | continue; |
| 213 | |
| 214 | // If we encounter ourselves, stop searching; this prevents duplicate |
| 215 | // firing of the assert, instead only firing for the latter encountered |
| 216 | // entry. |
| 217 | if(this == walk) |
| 218 | break; |
| 219 | |
| 220 | // Match! |
| 221 | if(this->className) |
| 222 | { |
| 223 | AssertISV(false, avar("ConsoleConstructor::setup - ConsoleMethod '%s::%s' collides with another of the same name.", this->className, this->funcName)); |
| 224 | } |
| 225 | else |
| 226 | { |
| 227 | AssertISV(false, avar("ConsoleConstructor::setup - ConsoleFunction '%s' collides with another of the same name.", this->funcName)); |
| 228 | } |
| 229 | } |
| 230 | #endif |
| 231 | } |
| 232 | |
| 233 | // We comment out the implementation of the Con namespace when doxygenizing because |
| 234 | // otherwise Doxygen decides to ignore our docs in console.h |