MCPcopy Create free account
hub / github.com/devosoft/avida / GetCellResourcePtr

Method GetCellResourcePtr

avida-core/source/main/cResource.cc:192–205  ·  view source on GitHub ↗

Return a pointer to cell resource with a given cell id, if there is no cell resource with that id return NULL */

Source from the content-addressed store, hash-verified

190/* Return a pointer to cell resource with a given cell id, if there is no
191 cell resource with that id return NULL */
192cCellResource *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 */
208void cResource::UpdateCellResource(cCellResource *_CellResourcePtr, double _initial,

Callers 1

LoadCellMethod · 0.80

Calls 2

GetIdMethod · 0.80
GetSizeMethod · 0.45

Tested by

no test coverage detected