/** * For copyright information see the LICENSE document. */ /** * Auto-generated by PacketCodeGen, on 2012-09-28 */ package com.gamerevision.gwlpr.actions.gameserver.stoc; import com.realityshard.shardlet.utils.GenericAction; import java.nio.BufferOverflowException; import java.nio.ByteBuffer; import java.nio.ByteOrder; /** * This is an automatically generated ShardletAction. * It resembles the packet template that has been * parsed from our packet templates xml. * * * @author GWLPR Template Updater */ public final class P309_CreateInventoryPageAction extends GenericAction { private short itemStreamID; private byte type; private byte storage; private short pageID; private byte slots; private int associatedItem; public short getHeader() { return 309; } public void setItemStreamID(short newValue) { itemStreamID = newValue; } public void setType(byte newValue) { type = newValue; } public void setStorage(byte newValue) { storage = newValue; } /** * new defined pageId used to refer to this inventory */ public void setPageID(short newValue) { pageID = newValue; } /** * number of slots in this new inventory */ public void setSlots(byte newValue) { slots = newValue; } /** * optional the id of the bag the inventory belongs to */ public void setAssociatedItem(int newValue) { associatedItem = newValue; } private int getSize() { return 13; } @Override public boolean serialize() { int size = getSize(); if (size == 0) { return false; } ByteBuffer buffer = ByteBuffer.allocate(size).order(ByteOrder.LITTLE_ENDIAN); try { buffer.putShort(getHeader()); buffer.putShort(itemStreamID); buffer.put(type); buffer.put(storage); buffer.putShort(pageID); buffer.put(slots); buffer.putInt(associatedItem); } catch (BufferOverflowException e) { return false; } setBuffer(buffer); return true; } }