| 389 | } |
| 390 | |
| 391 | TMError Detector::TransferMsg(NetworkMessageContext& ctx) |
| 392 | { |
| 393 | switch (ctx.GetClass()) |
| 394 | { |
| 395 | case NMCCreate: |
| 396 | if (ctx.IsSending()) |
| 397 | { |
| 398 | TMCHECK(base::TransferMsg(ctx)) |
| 399 | } |
| 400 | { |
| 401 | PoseidonAssert(dynamic_cast<const IndicesCreateDetector*>(ctx.GetIndices())) |
| 402 | const IndicesCreateDetector* indices = static_cast<const IndicesCreateDetector*>(ctx.GetIndices()); |
| 403 | |
| 404 | ITRANSF(a) |
| 405 | ITRANSF(b) |
| 406 | ITRANSF(sinAngle) |
| 407 | ITRANSF(cosAngle) |
| 408 | |
| 409 | ITRANSF(rectangular) |
| 410 | ITRANSF_ENUM(activationBy) |
| 411 | ITRANSF_ENUM(activationType) |
| 412 | ITRANSF(repeating) |
| 413 | ITRANSF(timeoutMin) |
| 414 | ITRANSF(timeoutMid) |
| 415 | ITRANSF(timeoutMax) |
| 416 | ITRANSF(interruptable) |
| 417 | ITRANSF_ENUM(action) |
| 418 | ITRANSF(assignedStatic) |
| 419 | ITRANSF(assignedVehicle) |
| 420 | ITRANSF(text) |
| 421 | ITRANSF(expCond) |
| 422 | ITRANSF(expActiv) |
| 423 | ITRANSF(expDesactiv) |
| 424 | ITRANSF(synchronizations) |
| 425 | TMCHECK(_effects.TransferMsg(ctx, indices->effects)) |
| 426 | if (!ctx.IsSending()) |
| 427 | { |
| 428 | _e = sqrt(Square(_a) - Square(_b)); |
| 429 | _cosAngle = sqrt(1 - Square(_sinAngle)); |
| 430 | _nextCheck = Glob.time - 1.0; |
| 431 | for (int i = 0; i < _synchronizations.Size(); i++) |
| 432 | { |
| 433 | int sync = _synchronizations[i]; |
| 434 | PoseidonAssert(sync >= 0); |
| 435 | if (sync >= synchronized.Size()) |
| 436 | { |
| 437 | synchronized.Resize(sync + 1); |
| 438 | } |
| 439 | synchronized[sync].Add(this); |
| 440 | } |
| 441 | } |
| 442 | } |
| 443 | break; |
| 444 | case NMCUpdateGeneric: |
| 445 | { |
| 446 | TMCHECK(base::TransferMsg(ctx)) |
| 447 | |
| 448 | PoseidonAssert(dynamic_cast<const IndicesUpdateDetector*>(ctx.GetIndices())) |
no test coverage detected