Return a pointer to cell resource with a given cell id, if there is no cell resource with that id return NULL */
| 190 | /* Return a pointer to cell resource with a given cell id, if there is no |
| 191 | cell resource with that id return NULL */ |
| 192 | cCellResource *cResource::GetCellResourcePtr(int _id) { |
| 193 | |
| 194 | bool found = false; |
| 195 | int cell_index = 0; |
| 196 | while (cell_index < cell_list.GetSize() && !found) { |
| 197 | if (cell_list[cell_index].GetId() == _id) { |
| 198 | return(&cell_list[cell_index]); |
| 199 | found = true; |
| 200 | } else { |
| 201 | cell_index++; |
| 202 | } |
| 203 | } |
| 204 | return(NULL); |
| 205 | } |
| 206 | |
| 207 | /* Update the values of given cell resource */ |
| 208 | void cResource::UpdateCellResource(cCellResource *_CellResourcePtr, double _initial, |