MCPcopy Create free account
hub / github.com/chrxh/alien / addAdditionalDataSizeForCell

Method addAdditionalDataSizeForCell

source/EngineImpl/DescriptionConverter.cpp:278–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void DescriptionConverter::addAdditionalDataSizeForCell(CellDescription const& cell, uint64_t& additionalDataSize) const
279{
280 additionalDataSize += cell.metadata.name.size() + cell.metadata.description.size();
281 switch (cell.getCellFunctionType()) {
282 case CellFunction_Neuron: {
283 additionalDataSize += MAX_CHANNELS * (MAX_CHANNELS + 1) * sizeof(float);
284 } break;
285 case CellFunction_Transmitter:
286 break;
287 case CellFunction_Constructor:
288 additionalDataSize += std::get<ConstructorDescription>(*cell.cellFunction).genome.size();
289 break;
290 case CellFunction_Sensor:
291 break;
292 case CellFunction_Nerve:
293 break;
294 case CellFunction_Attacker:
295 break;
296 case CellFunction_Injector:
297 additionalDataSize += std::get<InjectorDescription>(*cell.cellFunction).genome.size();
298 break;
299 case CellFunction_Muscle:
300 break;
301 case CellFunction_Defender:
302 break;
303 case CellFunction_Reconnector:
304 break;
305 case CellFunction_Detonator:
306 break;
307 }
308}
309
310namespace
311{

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
getCellFunctionTypeMethod · 0.45

Tested by

no test coverage detected