| 88 | } |
| 89 | |
| 90 | void NetElementGroup::readNetDelta(DataStream& ds, float interpolationTime, NetCompatibilityRules rules) { |
| 91 | if (!checkWithRules(rules)) |
| 92 | return; |
| 93 | if (m_elements.size() == 0) { |
| 94 | throw IOException("readNetDelta called on empty NetElementGroup"); |
| 95 | } else if (m_elements.size() == 1) { |
| 96 | m_elements[0].first->readNetDelta(ds, interpolationTime, rules); |
| 97 | } else { |
| 98 | uint64_t readIndex = ds.readVlqU(); |
| 99 | uint64_t i = 0; |
| 100 | uint64_t offset = 0; |
| 101 | for (auto& element : m_elements) { |
| 102 | if (!element.first->checkWithRules(rules)) { |
| 103 | offset++; |
| 104 | continue; |
| 105 | } |
| 106 | if (readIndex == 0 || readIndex - 1 > i) { |
| 107 | if (m_interpolationEnabled) |
| 108 | m_elements[i + offset].first->blankNetDelta(interpolationTime); |
| 109 | } else if (readIndex - 1 == i) { |
| 110 | m_elements[i + offset].first->readNetDelta(ds, interpolationTime, rules); |
| 111 | readIndex = ds.readVlqU(); |
| 112 | } else { |
| 113 | throw IOException("group indexes out of order in NetElementGroup::readNetDelta"); |
| 114 | } |
| 115 | ++i; |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | void NetElementGroup::blankNetDelta(float interpolationTime) { |
| 121 | if (m_interpolationEnabled) { |
nothing calls this directly
no test coverage detected