Package net.lightstone.model

Examples of net.lightstone.model.Coordinate


        buf.writeShort(item.getId());
        buf.writeByte(item.getCount());
        buf.writeShort(item.getDamage());
        break;
      case Parameter.TYPE_COORDINATE:
        Coordinate coord = ((Parameter<Coordinate>) parameter).getValue();
        buf.writeInt(coord.getX());
        buf.writeInt(coord.getY());
        buf.writeInt(coord.getZ());
        break;
      }
    }

    buf.writeByte(0x7F);
View Full Code Here


        break;
      case Parameter.TYPE_COORDINATE:
        int x = buf.readInt();
        int y = buf.readInt();
        int z = buf.readInt();
        Coordinate coordinate = new Coordinate(x, y, z);
        parameters[index] = new Parameter<Coordinate>(type, index, coordinate);
        break;
      }
    }
View Full Code Here

    params[1] = new Parameter<Short>(Parameter.TYPE_SHORT, 1, (short) 0x1234);
    params[2] = new Parameter<Integer>(Parameter.TYPE_INT, 2, (int) 0x12345678);
    params[3] = new Parameter<Float>(Parameter.TYPE_FLOAT, 3, 1234.5678F);
    params[4] = new Parameter<String>(Parameter.TYPE_STRING, 4, "test");
    params[5] = new Parameter<Item>(Parameter.TYPE_ITEM, 5, new Item(1, 64, 0));
    params[6] = new Parameter<Coordinate>(Parameter.TYPE_COORDINATE, 6, new Coordinate(10, 11, 12));

    ChannelBuffer buffer = ChannelBuffers.buffer(46);
    ChannelBufferUtils.writeParameters(buffer, params);

    assertEquals(0x00, buffer.readUnsignedByte());
View Full Code Here

    assertEquals(Parameter.TYPE_ITEM, itemParam.getType());
    assertEquals(new Item(1, 64, 0), itemParam.getValue());

    Parameter<?> coordinateParam = params[6];
    assertEquals(Parameter.TYPE_COORDINATE, coordinateParam.getType());
    assertEquals(new Coordinate(10, 11, 12), coordinateParam.getValue());
  }
View Full Code Here

TOP

Related Classes of net.lightstone.model.Coordinate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.