| 228 | |
| 229 | |
| 230 | int |
| 231 | Parameter::addObject(int paramID, MovableObject *object) |
| 232 | { |
| 233 | if (numObjects == maxNumObjects) { |
| 234 | maxNumObjects += expandSize; |
| 235 | MovableObject **newObjects = new MovableObject*[maxNumObjects]; |
| 236 | int *newParameterID = new int[maxNumObjects]; |
| 237 | |
| 238 | for (int i = 0; i < numObjects; i++) { |
| 239 | newObjects[i] = theObjects[i]; |
| 240 | newParameterID[i] = parameterID[i]; |
| 241 | } |
| 242 | |
| 243 | if (theObjects != 0) delete [] theObjects; |
| 244 | if (parameterID != 0) delete [] parameterID; |
| 245 | |
| 246 | theObjects = newObjects; |
| 247 | parameterID = newParameterID; |
| 248 | } |
| 249 | |
| 250 | parameterID[numObjects] = paramID; |
| 251 | theObjects[numObjects] = object; |
| 252 | numObjects++; |
| 253 | |
| 254 | return 0; |
| 255 | } |
| 256 | |
| 257 | |
| 258 | void |
no outgoing calls
no test coverage detected