示例#1
0
 /**
  * Sets the data
  *
  * @param buffer Bytebuffer to put data into
  */
 public void get(ByteBuffer buffer) {
   buffer.putInt((int) world.x);
   buffer.putInt((int) world.y);
   buffer.putDouble(radians);
   buffer.put((byte) (moving ? 1 : 0));
   for (Bullet b : gun.getBullets()) {
     if (b != null) {
       buffer.putInt((int) b.getWorld().x);
       buffer.putInt((int) b.getWorld().y);
       buffer.putDouble(b.getAngle());
     } else {
       buffer.putInt(-1);
       buffer.putInt(-1);
       buffer.putDouble(-1);
     }
   }
 }