Search in sources :

Example 1 with TakeTileItemMessage

use of org.apollo.game.message.impl.TakeTileItemMessage in project apollo by apollo-rsps.

the class TakeTileItemMessageDecoder method decode.

@Override
public TakeTileItemMessage decode(GamePacket packet) {
    GamePacketReader reader = new GamePacketReader(packet);
    int id = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
    int x = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD);
    int y = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD);
    return new TakeTileItemMessage(id, new Position(x, y));
}
Also used : GamePacketReader(org.apollo.net.codec.game.GamePacketReader) Position(org.apollo.game.model.Position) TakeTileItemMessage(org.apollo.game.message.impl.TakeTileItemMessage)

Example 2 with TakeTileItemMessage

use of org.apollo.game.message.impl.TakeTileItemMessage in project apollo by apollo-rsps.

the class TakeTileItemMessageDecoder method decode.

@Override
public TakeTileItemMessage decode(GamePacket packet) {
    GamePacketReader reader = new GamePacketReader(packet);
    int y = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
    int id = (int) reader.getUnsigned(DataType.SHORT);
    int x = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE);
    return new TakeTileItemMessage(id, new Position(x, y));
}
Also used : GamePacketReader(org.apollo.net.codec.game.GamePacketReader) Position(org.apollo.game.model.Position) TakeTileItemMessage(org.apollo.game.message.impl.TakeTileItemMessage)

Aggregations

TakeTileItemMessage (org.apollo.game.message.impl.TakeTileItemMessage)2 Position (org.apollo.game.model.Position)2 GamePacketReader (org.apollo.net.codec.game.GamePacketReader)2