public int serializedSize() { int resultsSize = 0; for (int i = 0; i < this.m_results.size(); ++i) { final DungeonLadderResult dungeonLadderResult = this.m_results.get(i); resultsSize += dungeonLadderResult.serializedSize(); } return 4 + resultsSize; }
public void removeResult(final long resultUid) { DungeonLadderResult resultToRemove = null; for (int i = 0, size = this.m_results.size(); i < size; ++i) { final DungeonLadderResult result = this.m_results.get(i); if (result.getUid() == resultUid) { resultToRemove = result; break; } } this.m_results.remove(resultToRemove); this.fireLadderChanged(); }
public void unserializeResults(final ByteBuffer buffer) { final short resultsCount = buffer.getShort(); for (int i = 0; i < resultsCount; ++i) { final DungeonLadderResult result = DungeonLadderResult.fromBuild(buffer); this.insertResult(result); } }