public static ItemBase DecodeItemData(ClientConnection pConnection, MaplePacket pPacket) { byte type = pPacket.ReadByte(); ItemBase ret = null; switch (type) { case 1: ret = new ItemEquip(); ret.Amount = 1; break; case 2: ret = new ItemRechargable(); break; case 3: ret = new ItemPet(); ret.Amount = 1; break; default: { Logger.WriteLine("Unkown ItemType: {0}", type); return null; } } ret.Decode(pConnection, pPacket); return ret; }
public static ItemBase DecodeItemData(ClientConnection pConnection, MaplePacket pPacket) { byte type = pPacket.ReadByte(); ItemBase ret = null; switch (type) { case 1: ret = new ItemEquip(); ret.Amount = 1; break; case 2: ret = new ItemRechargable(); break; case 3: ret = new ItemPet(); ret.Amount = 1; break; default: { Logger.WriteLine("Unkown ItemType: {0}", type); return(null); } } ret.Decode(pConnection, pPacket); return(ret); }