| 387 | TMCHECK(ctx.IdxTransferArray(indices->items, _items)) |
| 388 | return TMOK; |
| 389 | } |
| 390 | |
| 391 | int 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 |
no test coverage detected