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

Method TransferMsg

engine/Poseidon/World/Detection/Detector.cpp:391–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391TMError 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()))

Callers 1

CreateObjectMethod · 0.45

Calls 14

TMCHECKFunction · 0.85
sqrtFunction · 0.85
GlobLoadTextureFunction · 0.85
GetClassMethod · 0.80
IsSendingMethod · 0.80
SquareFunction · 0.50
GetIndicesMethod · 0.45
SizeMethod · 0.45
ResizeMethod · 0.45
AddMethod · 0.45
GetDebugNameMethod · 0.45
NameMethod · 0.45

Tested by

no test coverage detected