@Override public State pack(PackBuffer packBuffer) { this.time.pack(packBuffer); packBuffer.putBoolean(this.pos != null); if (this.pos != null) { this.pos.pack(packBuffer); } packBuffer.putBoolean(this.vel != null); if (this.vel != null) { this.vel.pack(packBuffer); } packBuffer.putBoolean(this.acc != null); if (this.acc != null) { this.acc.pack(packBuffer); } packBuffer.putBoolean(this.att != null); if (this.att != null) { this.att.pack(packBuffer); } packBuffer.putBoolean(this.angVel != null); if (this.angVel != null) { this.angVel.pack(packBuffer); } packBuffer.putBoolean(this.angAcc != null); if (this.angAcc != null) { this.angAcc.pack(packBuffer); } return this; }
@Override public State unpack(PackBuffer packBuffer) { this.time.unpack(packBuffer); if (packBuffer.getBoolean()) { if (this.pos == null) { this.pos = new Pos(); } this.pos.unpack(packBuffer); } else { this.pos = null; } if (packBuffer.getBoolean()) { if (this.vel == null) { this.vel = new Vel(); } this.vel.unpack(packBuffer); } else { this.vel = null; } if (packBuffer.getBoolean()) { if (this.acc == null) { this.acc = new Acc(); } this.acc.unpack(packBuffer); } else { this.acc = null; } if (packBuffer.getBoolean()) { if (this.att == null) { this.att = new Att(); } this.att.unpack(packBuffer); } else { this.att = null; } if (packBuffer.getBoolean()) { if (this.angVel == null) { this.angVel = new AngVel(); } this.angVel.unpack(packBuffer); } else { this.angVel = null; } if (packBuffer.getBoolean()) { if (this.angAcc == null) { this.angAcc = new AngAcc(); } this.angAcc.unpack(packBuffer); } else { this.angAcc = null; } return this; }