More ordinal refactor
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
package engine.net.client.msg;
|
||||
|
||||
|
||||
import engine.Enum;
|
||||
import engine.exception.SerializationException;
|
||||
import engine.net.AbstractConnection;
|
||||
import engine.net.ByteBufferReader;
|
||||
@@ -21,16 +22,16 @@ public class TransferItemFromEquipToInventoryMsg extends ClientNetMsg {
|
||||
|
||||
private int playerType;
|
||||
private int playerUUID;
|
||||
private int slotNumber;
|
||||
public Enum.EquipSlotType slot;
|
||||
|
||||
/**
|
||||
* This is the general purpose constructor.
|
||||
*/
|
||||
public TransferItemFromEquipToInventoryMsg(AbstractGameObject ago, int slotNumber) {
|
||||
public TransferItemFromEquipToInventoryMsg(AbstractGameObject ago, Enum.EquipSlotType slot) {
|
||||
super(Protocol.UNEQUIP);
|
||||
this.playerType = ago.getObjectType().ordinal();
|
||||
this.playerUUID = ago.getObjectUUID();
|
||||
this.slotNumber = slotNumber;
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,7 +51,7 @@ public class TransferItemFromEquipToInventoryMsg extends ClientNetMsg {
|
||||
protected void _deserialize(ByteBufferReader reader) {
|
||||
this.playerType = reader.getInt();
|
||||
this.playerUUID = reader.getInt();
|
||||
this.slotNumber = reader.getInt();
|
||||
this.slot = Enum.EquipSlotType.values()[reader.getInt()];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,16 +61,13 @@ public class TransferItemFromEquipToInventoryMsg extends ClientNetMsg {
|
||||
protected void _serialize(ByteBufferWriter writer) throws SerializationException {
|
||||
writer.putInt(this.playerType);
|
||||
writer.putInt(this.playerUUID);
|
||||
writer.putInt(this.slotNumber);
|
||||
writer.putInt(this.slot.ordinal());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the slotNumber
|
||||
*/
|
||||
public int getSlotNumber() {
|
||||
return slotNumber;
|
||||
}
|
||||
|
||||
public int getPlayerType() {
|
||||
return playerType;
|
||||
|
||||
Reference in New Issue
Block a user