Пример #1
0
    public void serialize(RbSerializer serializer, ByteBuffer buffer, Object object) {
      BulletHitBulletEvent obj = (BulletHitBulletEvent) object;

      // no need to transmit whole bullet, rest of it is already known to proxy side
      serializer.serialize(buffer, obj.bullet.getBulletId());
      serializer.serialize(buffer, RbSerializer.Bullet_TYPE, obj.hitBullet);
    }
    public void serialize(RbSerializer serializer, ByteBuffer buffer, Object object) {
      KeyPressedEvent obj = (KeyPressedEvent) object;
      java.awt.event.KeyEvent src = obj.getSourceEvent();

      serializer.serialize(buffer, src.getKeyChar());
      serializer.serialize(buffer, src.getKeyCode());
      serializer.serialize(buffer, src.getKeyLocation());
      serializer.serialize(buffer, src.getID());
      serializer.serialize(buffer, src.getModifiersEx());
      serializer.serialize(buffer, src.getWhen());
    }
Пример #3
0
    public int sizeOf(RbSerializer serializer, Object object) {
      BulletHitBulletEvent obj = (BulletHitBulletEvent) object;

      return RbSerializer.SIZEOF_TYPEINFO
          + RbSerializer.SIZEOF_INT
          + serializer.sizeOf(RbSerializer.Bullet_TYPE, obj.hitBullet);
    }
Пример #4
0
    public void serialize(RbSerializer serializer, ByteBuffer buffer, Object object) {
      MouseReleasedEvent obj = (MouseReleasedEvent) object;
      java.awt.event.MouseEvent src = obj.getSourceEvent();

      serializer.serialize(buffer, src.getButton());
      serializer.serialize(buffer, src.getClickCount());
      serializer.serialize(buffer, src.getX());
      serializer.serialize(buffer, src.getY());
      serializer.serialize(buffer, src.getID());
      serializer.serialize(buffer, src.getModifiersEx());
      serializer.serialize(buffer, src.getWhen());
    }
Пример #5
0
    public void serialize(RbSerializer serializer, ByteBuffer buffer, Object object) {
      BulletMissedEvent obj = (BulletMissedEvent) object;

      serializer.serialize(buffer, obj.bullet.getBulletId());
    }
Пример #6
0
    public void serialize(RbSerializer serializer, ByteBuffer buffer, Object object) {
      HitWallEvent obj = (HitWallEvent) object;

      serializer.serialize(buffer, obj.bearing);
    }
Пример #7
0
    public void serialize(RbSerializer serializer, ByteBuffer buffer, Object object) {
      SkippedTurnEvent obj = (SkippedTurnEvent) object;

      serializer.serialize(buffer, obj.skippedTurn);
    }
Пример #8
0
    public Object deserialize(RbSerializer serializer, ByteBuffer buffer) {
      Bullet bullet = new Bullet(0, 0, 0, 0, null, null, false, buffer.getInt());
      Bullet hitBullet = (Bullet) serializer.deserializeAny(buffer);

      return new BulletHitBulletEvent(bullet, hitBullet);
    }