MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / Add

Method Add

engine/Poseidon/Network/NetworkMsg.cpp:389–414  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

387 TMCHECK(ctx.IdxTransferArray(indices->items, _items))
388 return TMOK;
389}
390
391int NetworkMessageFormat::Add(const char* name, NetworkDataType type, NetworkCompressionType compression,
392 const RefNetworkData& defValue, const char* description, NetworkMessageErrorType errType,
393 float errCoef)
394{
395 // add to items
396 int index = _items.Add();
397 NetworkMessageFormatItem& item = _items[index];
398 item.name = name;
399 item.type = type;
400 item.compression = compression;
401 item.defValue = defValue;
402
403 // add to errors
404 DoVerify(_errors.Add() == index);
405 NetworkMessageErrorInfo& info = _errors[index];
406 info.type = errType;
407 info.coef = errCoef;
408
409 // add to descriptions
410#if DOCUMENT_MSG_FORMATS
411 DoVerify(_descriptions.Add() == index);
412 _descriptions[index] = description;
413#endif
414
415 return index;
416}
417

Callers 2

InitMethod · 0.45
NetworkMsg.cppFile · 0.45

Calls 1

RefNetworkDataNullClass · 0.85

Tested by

no test coverage detected